resolve: More precise spans for privacy errors

This commit is contained in:
Vadim Petrochenkov 2018-10-27 20:21:34 +03:00
parent b45b4daba7
commit acdbd0643c
45 changed files with 276 additions and 281 deletions

View File

@ -1207,7 +1207,7 @@ enum NameBindingKind<'a> {
} }
} }
struct PrivacyError<'a>(Span, Name, &'a NameBinding<'a>); struct PrivacyError<'a>(Span, Ident, &'a NameBinding<'a>);
struct UseError<'a> { struct UseError<'a> {
err: DiagnosticBuilder<'a>, err: DiagnosticBuilder<'a>,
@ -4743,9 +4743,11 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
} }
} }
for &PrivacyError(span, name, binding) in &self.privacy_errors { for &PrivacyError(dedup_span, ident, binding) in &self.privacy_errors {
if !reported_spans.insert(span) { continue } if reported_spans.insert(dedup_span) {
span_err!(self.session, span, E0603, "{} `{}` is private", binding.descr(), name); span_err!(self.session, ident.span, E0603, "{} `{}` is private",
binding.descr(), ident.name);
}
} }
} }

View File

@ -275,7 +275,7 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
return Ok(self.dummy_binding); return Ok(self.dummy_binding);
} }
if !self.is_accessible(binding.vis) { if !self.is_accessible(binding.vis) {
self.privacy_errors.push(PrivacyError(path_span, ident.name, binding)); self.privacy_errors.push(PrivacyError(path_span, ident, binding));
} }
} }

View File

@ -1,8 +1,8 @@
error[E0603]: constant `PRIVATE` is private error[E0603]: constant `PRIVATE` is private
--> $DIR/E0603.rs:16:5 --> $DIR/E0603.rs:16:17
| |
LL | SomeModule::PRIVATE; //~ ERROR E0603 LL | SomeModule::PRIVATE; //~ ERROR E0603
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -5,10 +5,10 @@ LL | y = 2;
| ^ did you mean `x`? | ^ did you mean `x`?
error[E0603]: constant `FOO` is private error[E0603]: constant `FOO` is private
--> $DIR/error-festival.rs:32:5 --> $DIR/error-festival.rs:32:10
| |
LL | foo::FOO; LL | foo::FOO;
| ^^^^^^^^ | ^^^
error[E0368]: binary assignment operation `+=` cannot be applied to type `&str` error[E0368]: binary assignment operation `+=` cannot be applied to type `&str`
--> $DIR/error-festival.rs:22:5 --> $DIR/error-festival.rs:22:5

View File

@ -1,8 +1,8 @@
error[E0603]: function `unexported` is private error[E0603]: function `unexported` is private
--> $DIR/export-import.rs:11:5 --> $DIR/export-import.rs:11:8
| |
LL | use m::unexported; LL | use m::unexported;
| ^^^^^^^^^^^^^ | ^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,8 +1,8 @@
error[E0603]: enum `y` is private error[E0603]: enum `y` is private
--> $DIR/export-tag-variant.rs:17:21 --> $DIR/export-tag-variant.rs:17:26
| |
LL | fn main() { let z = foo::y::y1; } //~ ERROR: enum `y` is private LL | fn main() { let z = foo::y::y1; } //~ ERROR: enum `y` is private
| ^^^^^^^^^^ | ^
error: aborting due to previous error error: aborting due to previous error

View File

@ -23,10 +23,10 @@ LL | fn z(y: isize) { log(debug, y); }
| ^^^^^ not found in this scope | ^^^^^ not found in this scope
error[E0603]: function `z` is private error[E0603]: function `z` is private
--> $DIR/export.rs:20:13 --> $DIR/export.rs:20:18
| |
LL | fn main() { foo::z(10); } //~ ERROR function `z` is private LL | fn main() { foo::z(10); } //~ ERROR function `z` is private
| ^^^^^^ | ^
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View File

@ -1,14 +1,14 @@
error[E0603]: extern crate `core` is private error[E0603]: extern crate `core` is private
--> $DIR/extern-crate-visibility.rs:16:5 --> $DIR/extern-crate-visibility.rs:16:10
| |
LL | use foo::core::cell; //~ ERROR extern crate `core` is private LL | use foo::core::cell; //~ ERROR extern crate `core` is private
| ^^^^^^^^^^^^^^^ | ^^^^
error[E0603]: extern crate `core` is private error[E0603]: extern crate `core` is private
--> $DIR/extern-crate-visibility.rs:19:5 --> $DIR/extern-crate-visibility.rs:19:10
| |
LL | foo::core::cell::Cell::new(0); //~ ERROR extern crate `core` is private LL | foo::core::cell::Cell::new(0); //~ ERROR extern crate `core` is private
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,8 +1,8 @@
error[E0603]: function `f` is private error[E0603]: function `f` is private
--> $DIR/privacy.rs:26:9 --> $DIR/privacy.rs:26:14
| |
LL | foo::f() //~ ERROR `f` is private LL | foo::f() //~ ERROR `f` is private
| ^^^^^^ | ^
error: aborting due to previous error error: aborting due to previous error

View File

@ -11,10 +11,10 @@ LL | use foo; //~ ERROR unresolved import `foo` [E0432]
| ^^^ no `foo` in the root | ^^^ no `foo` in the root
error[E0603]: unresolved item `foo` is private error[E0603]: unresolved item `foo` is private
--> $DIR/import.rs:23:5 --> $DIR/import.rs:23:10
| |
LL | zed::foo(); //~ ERROR `foo` is private LL | zed::foo(); //~ ERROR `foo` is private
| ^^^^^^^^ | ^^^
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -17,16 +17,16 @@ LL | pub use super::*; //~ ERROR must import something with the glob's v
| ^^^^^^^^ | ^^^^^^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/reexports.rs:38:9 --> $DIR/reexports.rs:38:15
| |
LL | use b::a::foo::S; //~ ERROR `foo` LL | use b::a::foo::S; //~ ERROR `foo`
| ^^^^^^^^^^^^ | ^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/reexports.rs:39:9 --> $DIR/reexports.rs:39:15
| |
LL | use b::b::foo::S as T; //~ ERROR `foo` LL | use b::b::foo::S as T; //~ ERROR `foo`
| ^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -1,8 +1,8 @@
error[E0603]: struct `S` is private error[E0603]: struct `S` is private
--> $DIR/issue-10545.rs:17:11 --> $DIR/issue-10545.rs:17:14
| |
LL | fn foo(_: a::S) { //~ ERROR: struct `S` is private LL | fn foo(_: a::S) { //~ ERROR: struct `S` is private
| ^^^^ | ^
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,8 +1,8 @@
error[E0603]: trait `Foo` is private error[E0603]: trait `Foo` is private
--> $DIR/issue-11593.rs:17:6 --> $DIR/issue-11593.rs:17:24
| |
LL | impl private_trait_xc::Foo for Bar {} LL | impl private_trait_xc::Foo for Bar {}
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,14 +1,14 @@
error[E0603]: enum `Foo` is private error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:16:14 --> $DIR/issue-11680.rs:16:21
| |
LL | let _b = other::Foo::Bar(1); LL | let _b = other::Foo::Bar(1);
| ^^^^^^^^^^^^^^^ | ^^^
error[E0603]: enum `Foo` is private error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:19:14 --> $DIR/issue-11680.rs:19:27
| |
LL | let _b = other::test::Foo::Bar(1); LL | let _b = other::test::Foo::Bar(1);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,8 +1,8 @@
error[E0603]: unit struct `C` is private error[E0603]: unit struct `C` is private
--> $DIR/issue-13407.rs:16:5 --> $DIR/issue-13407.rs:16:8
| |
LL | A::C = 1; LL | A::C = 1;
| ^^^^ | ^
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-13407.rs:16:12 --> $DIR/issue-13407.rs:16:12

View File

@ -1,14 +1,14 @@
error[E0603]: struct `Foo` is private error[E0603]: struct `Foo` is private
--> $DIR/issue-13641.rs:19:5 --> $DIR/issue-13641.rs:19:8
| |
LL | a::Foo::new(); LL | a::Foo::new();
| ^^^^^^^^^^^ | ^^^
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/issue-13641.rs:21:5 --> $DIR/issue-13641.rs:21:8
| |
LL | a::Bar::new(); LL | a::Bar::new();
| ^^^^^^^^^^^ | ^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,8 +1,8 @@
error[E0603]: function `bar` is private error[E0603]: function `bar` is private
--> $DIR/issue-16725.rs:16:14 --> $DIR/issue-16725.rs:16:19
| |
LL | unsafe { foo::bar(); } LL | unsafe { foo::bar(); }
| ^^^^^^^^ | ^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,8 +1,8 @@
error[E0603]: constant `B` is private error[E0603]: constant `B` is private
--> $DIR/issue-17718-const-privacy.rs:15:5 --> $DIR/issue-17718-const-privacy.rs:15:8
| |
LL | use a::B; //~ ERROR: constant `B` is private LL | use a::B; //~ ERROR: constant `B` is private
| ^^^^ | ^
error[E0603]: constant `BAR` is private error[E0603]: constant `BAR` is private
--> $DIR/issue-17718-const-privacy.rs:18:5 --> $DIR/issue-17718-const-privacy.rs:18:5

View File

@ -1,8 +1,8 @@
error[E0603]: module `n` is private error[E0603]: module `n` is private
--> $DIR/issue-28388-2.rs:17:5 --> $DIR/issue-28388-2.rs:17:8
| |
LL | use m::n::{}; LL | use m::n::{};
| ^^^^^^^^ | ^
error: aborting due to previous error error: aborting due to previous error

View File

@ -5,10 +5,10 @@ LL | pub fn default() -> A { //~ ERROR unnecessary visibility qualifier
| ^^^ `pub` not permitted here because it's implied | ^^^ `pub` not permitted here because it's implied
error[E0603]: struct `A` is private error[E0603]: struct `A` is private
--> $DIR/issue-29161.rs:23:5 --> $DIR/issue-29161.rs:23:8
| |
LL | a::A::default(); LL | a::A::default();
| ^^^^^^^^^^^^^ | ^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -5,10 +5,10 @@ LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!()
| ^^^ Could not find `imp` in `sys` | ^^^ Could not find `imp` in `sys`
error[E0603]: module `sys` is private error[E0603]: module `sys` is private
--> $DIR/issue-38857.rs:12:13 --> $DIR/issue-38857.rs:12:18
| |
LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,8 +1,8 @@
error[E0603]: function `fly` is private error[E0603]: function `fly` is private
--> $DIR/issue-3993.rs:11:5 --> $DIR/issue-3993.rs:11:10
| |
LL | use zoo::fly; //~ ERROR: function `fly` is private LL | use zoo::fly; //~ ERROR: function `fly` is private
| ^^^^^^^^ | ^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,8 +1,8 @@
error[E0603]: constant `baz` is private error[E0603]: constant `baz` is private
--> $DIR/macro-local-data-key-priv.rs:18:5 --> $DIR/macro-local-data-key-priv.rs:18:10
| |
LL | bar::baz.with(|_| ()); LL | bar::baz.with(|_| ());
| ^^^^^^^^ | ^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,20 +1,20 @@
error[E0603]: module `bar` is private error[E0603]: module `bar` is private
--> $DIR/privacy-in-paths.rs:34:9 --> $DIR/privacy-in-paths.rs:34:16
| |
LL | ::foo::bar::baz::f(); //~ERROR module `bar` is private LL | ::foo::bar::baz::f(); //~ERROR module `bar` is private
| ^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `bar` is private error[E0603]: module `bar` is private
--> $DIR/privacy-in-paths.rs:35:9 --> $DIR/privacy-in-paths.rs:35:16
| |
LL | ::foo::bar::S::f(); //~ERROR module `bar` is private LL | ::foo::bar::S::f(); //~ERROR module `bar` is private
| ^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: trait `T` is private error[E0603]: trait `T` is private
--> $DIR/privacy-in-paths.rs:36:9 --> $DIR/privacy-in-paths.rs:36:23
| |
LL | <() as ::foo::T>::Assoc::f(); //~ERROR trait `T` is private LL | <() as ::foo::T>::Assoc::f(); //~ERROR trait `T` is private
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -55,16 +55,16 @@ LL | use foo3::Bar;
| |
error[E0603]: trait `Bar` is private error[E0603]: trait `Bar` is private
--> $DIR/privacy-ns2.rs:70:9 --> $DIR/privacy-ns2.rs:70:15
| |
LL | use foo3::Bar; //~ ERROR `Bar` is private LL | use foo3::Bar; //~ ERROR `Bar` is private
| ^^^^^^^^^ | ^^^
error[E0603]: trait `Bar` is private error[E0603]: trait `Bar` is private
--> $DIR/privacy-ns2.rs:74:9 --> $DIR/privacy-ns2.rs:74:15
| |
LL | use foo3::Bar; //~ ERROR `Bar` is private LL | use foo3::Bar; //~ ERROR `Bar` is private
| ^^^^^^^^^ | ^^^
error[E0603]: trait `Bar` is private error[E0603]: trait `Bar` is private
--> $DIR/privacy-ns2.rs:81:16 --> $DIR/privacy-ns2.rs:81:16

View File

@ -1,8 +1,8 @@
error[E0603]: trait `Bar` is private error[E0603]: trait `Bar` is private
--> $DIR/privacy-ufcs.rs:22:5 --> $DIR/privacy-ufcs.rs:22:20
| |
LL | <i32 as ::foo::Bar>::baz(); //~ERROR trait `Bar` is private LL | <i32 as ::foo::Bar>::baz(); //~ERROR trait `Bar` is private
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -127,7 +127,6 @@ mod foo {
fn test2() { fn test2() {
use bar::baz::{foo, bar}; use bar::baz::{foo, bar};
//~^ ERROR: module `baz` is private //~^ ERROR: module `baz` is private
//~| ERROR: module `baz` is private
foo(); foo();
bar(); bar();

View File

@ -1,80 +1,74 @@
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:128:24 --> $DIR/privacy1.rs:128:18
| |
LL | use bar::baz::{foo, bar}; LL | use bar::baz::{foo, bar};
| ^^^ | ^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:128:29 --> $DIR/privacy1.rs:136:18
|
LL | use bar::baz::{foo, bar};
| ^^^
error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:137:13
| |
LL | use bar::baz; LL | use bar::baz;
| ^^^^^^^^ | ^^^
error[E0603]: module `i` is private error[E0603]: module `i` is private
--> $DIR/privacy1.rs:161:9 --> $DIR/privacy1.rs:160:20
| |
LL | use self::foo::i::A; //~ ERROR: module `i` is private LL | use self::foo::i::A; //~ ERROR: module `i` is private
| ^^^^^^^^^^^^^^^ | ^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:100:9 --> $DIR/privacy1.rs:100:16
| |
LL | ::bar::baz::A::foo(); //~ ERROR: module `baz` is private LL | ::bar::baz::A::foo(); //~ ERROR: module `baz` is private
| ^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:101:9 --> $DIR/privacy1.rs:101:16
| |
LL | ::bar::baz::A::bar(); //~ ERROR: module `baz` is private LL | ::bar::baz::A::bar(); //~ ERROR: module `baz` is private
| ^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:103:9 --> $DIR/privacy1.rs:103:16
| |
LL | ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private LL | ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private
| ^^^^^^^^^^^^^ | ^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:104:9 --> $DIR/privacy1.rs:104:16
| |
LL | ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private LL | ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private
| ^^^^^^^^^^^^^ | ^^^
error[E0603]: trait `B` is private error[E0603]: trait `B` is private
--> $DIR/privacy1.rs:108:9 --> $DIR/privacy1.rs:108:16
| |
LL | ::bar::B::foo(); //~ ERROR: trait `B` is private LL | ::bar::B::foo(); //~ ERROR: trait `B` is private
| ^^^^^^^^^^^^^ | ^
error[E0603]: function `epriv` is private error[E0603]: function `epriv` is private
--> $DIR/privacy1.rs:114:13 --> $DIR/privacy1.rs:114:20
| |
LL | ::bar::epriv(); //~ ERROR: function `epriv` is private LL | ::bar::epriv(); //~ ERROR: function `epriv` is private
| ^^^^^^^^^^^^ | ^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:123:9 --> $DIR/privacy1.rs:123:16
| |
LL | ::bar::baz::foo(); //~ ERROR: module `baz` is private LL | ::bar::baz::foo(); //~ ERROR: module `baz` is private
| ^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:124:9 --> $DIR/privacy1.rs:124:16
| |
LL | ::bar::baz::bar(); //~ ERROR: module `baz` is private LL | ::bar::baz::bar(); //~ ERROR: module `baz` is private
| ^^^^^^^^^^^^^^^ | ^^^
error[E0603]: trait `B` is private error[E0603]: trait `B` is private
--> $DIR/privacy1.rs:153:10 --> $DIR/privacy1.rs:152:17
| |
LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } } LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } }
| ^^^^^^^^ | ^
error[E0624]: method `bar` is private error[E0624]: method `bar` is private
--> $DIR/privacy1.rs:73:9 --> $DIR/privacy1.rs:73:9
@ -106,7 +100,7 @@ error[E0624]: method `bar2` is private
LL | ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private LL | ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private
| ^^^^ | ^^^^
error: aborting due to 18 previous errors error: aborting due to 17 previous errors
Some errors occurred: E0603, E0624. Some errors occurred: E0603, E0624.
For more information about an error, try `rustc --explain E0603`. For more information about an error, try `rustc --explain E0603`.

View File

@ -5,10 +5,10 @@ LL | use bar::foo;
| ^^^^^^^^ no `foo` in `bar` | ^^^^^^^^ no `foo` in `bar`
error[E0603]: function `foo` is private error[E0603]: function `foo` is private
--> $DIR/privacy2.rs:33:9 --> $DIR/privacy2.rs:33:20
| |
LL | use bar::glob::foo; LL | use bar::glob::foo;
| ^^^^^^^^^^^^^^ | ^^^
error: requires `sized` lang_item error: requires `sized` lang_item

View File

@ -1,8 +1,8 @@
error[E0603]: module `glob` is private error[E0603]: module `glob` is private
--> $DIR/privacy4.rs:31:9 --> $DIR/privacy4.rs:31:14
| |
LL | use bar::glob::gpriv; //~ ERROR: module `glob` is private LL | use bar::glob::gpriv; //~ ERROR: module `glob` is private
| ^^^^^^^^^^^^^^^^ | ^^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,290 +1,290 @@
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:61:13 --> $DIR/privacy5.rs:61:16
| |
LL | let a = a::A(()); //~ ERROR tuple struct `A` is private LL | let a = a::A(()); //~ ERROR tuple struct `A` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:62:13 --> $DIR/privacy5.rs:62:16
| |
LL | let b = a::B(2); //~ ERROR tuple struct `B` is private LL | let b = a::B(2); //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:63:13 --> $DIR/privacy5.rs:63:16
| |
LL | let c = a::C(2, 3); //~ ERROR tuple struct `C` is private LL | let c = a::C(2, 3); //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:66:9 --> $DIR/privacy5.rs:66:12
| |
LL | let a::A(()) = a; //~ ERROR tuple struct `A` is private LL | let a::A(()) = a; //~ ERROR tuple struct `A` is private
| ^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:67:9 --> $DIR/privacy5.rs:67:12
| |
LL | let a::A(_) = a; //~ ERROR tuple struct `A` is private LL | let a::A(_) = a; //~ ERROR tuple struct `A` is private
| ^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:68:15 --> $DIR/privacy5.rs:68:18
| |
LL | match a { a::A(()) => {} } //~ ERROR tuple struct `A` is private LL | match a { a::A(()) => {} } //~ ERROR tuple struct `A` is private
| ^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:69:15 --> $DIR/privacy5.rs:69:18
| |
LL | match a { a::A(_) => {} } //~ ERROR tuple struct `A` is private LL | match a { a::A(_) => {} } //~ ERROR tuple struct `A` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:71:9 --> $DIR/privacy5.rs:71:12
| |
LL | let a::B(_) = b; //~ ERROR tuple struct `B` is private LL | let a::B(_) = b; //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:72:9 --> $DIR/privacy5.rs:72:12
| |
LL | let a::B(_b) = b; //~ ERROR tuple struct `B` is private LL | let a::B(_b) = b; //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:73:15 --> $DIR/privacy5.rs:73:18
| |
LL | match b { a::B(_) => {} } //~ ERROR tuple struct `B` is private LL | match b { a::B(_) => {} } //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:74:15 --> $DIR/privacy5.rs:74:18
| |
LL | match b { a::B(_b) => {} } //~ ERROR tuple struct `B` is private LL | match b { a::B(_b) => {} } //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:75:15 --> $DIR/privacy5.rs:75:18
| |
LL | match b { a::B(1) => {} a::B(_) => {} } //~ ERROR tuple struct `B` is private LL | match b { a::B(1) => {} a::B(_) => {} } //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:75:29 --> $DIR/privacy5.rs:75:32
| |
LL | match b { a::B(1) => {} a::B(_) => {} } //~ ERROR tuple struct `B` is private LL | match b { a::B(1) => {} a::B(_) => {} } //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:78:9 --> $DIR/privacy5.rs:78:12
| |
LL | let a::C(_, _) = c; //~ ERROR tuple struct `C` is private LL | let a::C(_, _) = c; //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:79:9 --> $DIR/privacy5.rs:79:12
| |
LL | let a::C(_a, _) = c; //~ ERROR tuple struct `C` is private LL | let a::C(_a, _) = c; //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:80:9 --> $DIR/privacy5.rs:80:12
| |
LL | let a::C(_, _b) = c; //~ ERROR tuple struct `C` is private LL | let a::C(_, _b) = c; //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:81:9 --> $DIR/privacy5.rs:81:12
| |
LL | let a::C(_a, _b) = c; //~ ERROR tuple struct `C` is private LL | let a::C(_a, _b) = c; //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:82:15 --> $DIR/privacy5.rs:82:18
| |
LL | match c { a::C(_, _) => {} } //~ ERROR tuple struct `C` is private LL | match c { a::C(_, _) => {} } //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:83:15 --> $DIR/privacy5.rs:83:18
| |
LL | match c { a::C(_a, _) => {} } //~ ERROR tuple struct `C` is private LL | match c { a::C(_a, _) => {} } //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:84:15 --> $DIR/privacy5.rs:84:18
| |
LL | match c { a::C(_, _b) => {} } //~ ERROR tuple struct `C` is private LL | match c { a::C(_, _b) => {} } //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:85:15 --> $DIR/privacy5.rs:85:18
| |
LL | match c { a::C(_a, _b) => {} } //~ ERROR tuple struct `C` is private LL | match c { a::C(_a, _b) => {} } //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:93:14 --> $DIR/privacy5.rs:93:17
| |
LL | let a2 = a::A; //~ ERROR tuple struct `A` is private LL | let a2 = a::A; //~ ERROR tuple struct `A` is private
| ^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:94:14 --> $DIR/privacy5.rs:94:17
| |
LL | let b2 = a::B; //~ ERROR tuple struct `B` is private LL | let b2 = a::B; //~ ERROR tuple struct `B` is private
| ^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:95:14 --> $DIR/privacy5.rs:95:17
| |
LL | let c2 = a::C; //~ ERROR tuple struct `C` is private LL | let c2 = a::C; //~ ERROR tuple struct `C` is private
| ^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:100:13 --> $DIR/privacy5.rs:100:20
| |
LL | let a = other::A(()); //~ ERROR tuple struct `A` is private LL | let a = other::A(()); //~ ERROR tuple struct `A` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:101:13 --> $DIR/privacy5.rs:101:20
| |
LL | let b = other::B(2); //~ ERROR tuple struct `B` is private LL | let b = other::B(2); //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:102:13 --> $DIR/privacy5.rs:102:20
| |
LL | let c = other::C(2, 3); //~ ERROR tuple struct `C` is private LL | let c = other::C(2, 3); //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:105:9 --> $DIR/privacy5.rs:105:16
| |
LL | let other::A(()) = a; //~ ERROR tuple struct `A` is private LL | let other::A(()) = a; //~ ERROR tuple struct `A` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:106:9 --> $DIR/privacy5.rs:106:16
| |
LL | let other::A(_) = a; //~ ERROR tuple struct `A` is private LL | let other::A(_) = a; //~ ERROR tuple struct `A` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:107:15 --> $DIR/privacy5.rs:107:22
| |
LL | match a { other::A(()) => {} } //~ ERROR tuple struct `A` is private LL | match a { other::A(()) => {} } //~ ERROR tuple struct `A` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:108:15 --> $DIR/privacy5.rs:108:22
| |
LL | match a { other::A(_) => {} } //~ ERROR tuple struct `A` is private LL | match a { other::A(_) => {} } //~ ERROR tuple struct `A` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:110:9 --> $DIR/privacy5.rs:110:16
| |
LL | let other::B(_) = b; //~ ERROR tuple struct `B` is private LL | let other::B(_) = b; //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:111:9 --> $DIR/privacy5.rs:111:16
| |
LL | let other::B(_b) = b; //~ ERROR tuple struct `B` is private LL | let other::B(_b) = b; //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:112:15 --> $DIR/privacy5.rs:112:22
| |
LL | match b { other::B(_) => {} } //~ ERROR tuple struct `B` is private LL | match b { other::B(_) => {} } //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:113:15 --> $DIR/privacy5.rs:113:22
| |
LL | match b { other::B(_b) => {} } //~ ERROR tuple struct `B` is private LL | match b { other::B(_b) => {} } //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:114:15 --> $DIR/privacy5.rs:114:22
| |
LL | match b { other::B(1) => {} other::B(_) => {} } //~ ERROR tuple struct `B` is private LL | match b { other::B(1) => {} other::B(_) => {} } //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:114:33 --> $DIR/privacy5.rs:114:40
| |
LL | match b { other::B(1) => {} other::B(_) => {} } //~ ERROR tuple struct `B` is private LL | match b { other::B(1) => {} other::B(_) => {} } //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:117:9 --> $DIR/privacy5.rs:117:16
| |
LL | let other::C(_, _) = c; //~ ERROR tuple struct `C` is private LL | let other::C(_, _) = c; //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:118:9 --> $DIR/privacy5.rs:118:16
| |
LL | let other::C(_a, _) = c; //~ ERROR tuple struct `C` is private LL | let other::C(_a, _) = c; //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:119:9 --> $DIR/privacy5.rs:119:16
| |
LL | let other::C(_, _b) = c; //~ ERROR tuple struct `C` is private LL | let other::C(_, _b) = c; //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:120:9 --> $DIR/privacy5.rs:120:16
| |
LL | let other::C(_a, _b) = c; //~ ERROR tuple struct `C` is private LL | let other::C(_a, _b) = c; //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:121:15 --> $DIR/privacy5.rs:121:22
| |
LL | match c { other::C(_, _) => {} } //~ ERROR tuple struct `C` is private LL | match c { other::C(_, _) => {} } //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:122:15 --> $DIR/privacy5.rs:122:22
| |
LL | match c { other::C(_a, _) => {} } //~ ERROR tuple struct `C` is private LL | match c { other::C(_a, _) => {} } //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:123:15 --> $DIR/privacy5.rs:123:22
| |
LL | match c { other::C(_, _b) => {} } //~ ERROR tuple struct `C` is private LL | match c { other::C(_, _b) => {} } //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:124:15 --> $DIR/privacy5.rs:124:22
| |
LL | match c { other::C(_a, _b) => {} } //~ ERROR tuple struct `C` is private LL | match c { other::C(_a, _b) => {} } //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `A` is private error[E0603]: tuple struct `A` is private
--> $DIR/privacy5.rs:132:14 --> $DIR/privacy5.rs:132:21
| |
LL | let a2 = other::A; //~ ERROR tuple struct `A` is private LL | let a2 = other::A; //~ ERROR tuple struct `A` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `B` is private error[E0603]: tuple struct `B` is private
--> $DIR/privacy5.rs:133:14 --> $DIR/privacy5.rs:133:21
| |
LL | let b2 = other::B; //~ ERROR tuple struct `B` is private LL | let b2 = other::B; //~ ERROR tuple struct `B` is private
| ^^^^^^^^ | ^
error[E0603]: tuple struct `C` is private error[E0603]: tuple struct `C` is private
--> $DIR/privacy5.rs:134:14 --> $DIR/privacy5.rs:134:21
| |
LL | let c2 = other::C; //~ ERROR tuple struct `C` is private LL | let c2 = other::C; //~ ERROR tuple struct `C` is private
| ^^^^^^^^ | ^
error: aborting due to 48 previous errors error: aborting due to 48 previous errors

View File

@ -1,8 +1,8 @@
error[E0603]: function `f` is private error[E0603]: function `f` is private
--> $DIR/private-item-simple.rs:16:5 --> $DIR/private-item-simple.rs:16:8
| |
LL | a::f(); //~ ERROR function `f` is private LL | a::f(); //~ ERROR function `f` is private
| ^^^^ | ^
error: aborting due to previous error error: aborting due to previous error

View File

@ -23,16 +23,16 @@ LL | pub(super) use foo::bar::f as g; //~ ERROR cannot be re-exported
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error[E0603]: struct `Crate` is private error[E0603]: struct `Crate` is private
--> $DIR/test.rs:48:9 --> $DIR/test.rs:48:25
| |
LL | use pub_restricted::Crate; //~ ERROR private LL | use pub_restricted::Crate; //~ ERROR private
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^
error[E0603]: function `f` is private error[E0603]: function `f` is private
--> $DIR/test.rs:40:9 --> $DIR/test.rs:40:19
| |
LL | use foo::bar::f; //~ ERROR private LL | use foo::bar::f; //~ ERROR private
| ^^^^^^^^^^^ | ^
error[E0616]: field `x` of struct `foo::bar::S` is private error[E0616]: field `x` of struct `foo::bar::S` is private
--> $DIR/test.rs:41:5 --> $DIR/test.rs:41:5

View File

@ -132,28 +132,28 @@ LL | use m::n::Z;
| |
error[E0603]: enum `Z` is private error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:67:16 --> $DIR/privacy-enum-ctor.rs:67:22
| |
LL | let _: Z = m::n::Z; LL | let _: Z = m::n::Z;
| ^^^^^^^ | ^
error[E0603]: enum `Z` is private error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:71:16 --> $DIR/privacy-enum-ctor.rs:71:22
| |
LL | let _: Z = m::n::Z::Fn; LL | let _: Z = m::n::Z::Fn;
| ^^^^^^^^^^^ | ^
error[E0603]: enum `Z` is private error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:74:16 --> $DIR/privacy-enum-ctor.rs:74:22
| |
LL | let _: Z = m::n::Z::Struct; LL | let _: Z = m::n::Z::Struct;
| ^^^^^^^^^^^^^^^ | ^
error[E0603]: enum `Z` is private error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:78:16 --> $DIR/privacy-enum-ctor.rs:78:22
| |
LL | let _: Z = m::n::Z::Unit {}; LL | let _: Z = m::n::Z::Unit {};
| ^^^^^^^^^^^^^ | ^
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/privacy-enum-ctor.rs:37:20 --> $DIR/privacy-enum-ctor.rs:37:20

View File

@ -38,40 +38,40 @@ LL | use m::S;
| |
error[E0603]: tuple struct `Z` is private error[E0603]: tuple struct `Z` is private
--> $DIR/privacy-struct-ctor.rs:28:9 --> $DIR/privacy-struct-ctor.rs:28:12
| |
LL | n::Z; LL | n::Z;
| ^^^^ | ^
error[E0603]: tuple struct `S` is private error[E0603]: tuple struct `S` is private
--> $DIR/privacy-struct-ctor.rs:39:5 --> $DIR/privacy-struct-ctor.rs:39:8
| |
LL | m::S; LL | m::S;
| ^^^^ | ^
error[E0603]: tuple struct `S` is private error[E0603]: tuple struct `S` is private
--> $DIR/privacy-struct-ctor.rs:41:16 --> $DIR/privacy-struct-ctor.rs:41:19
| |
LL | let _: S = m::S(2); LL | let _: S = m::S(2);
| ^^^^ | ^
error[E0603]: tuple struct `Z` is private error[E0603]: tuple struct `Z` is private
--> $DIR/privacy-struct-ctor.rs:45:5 --> $DIR/privacy-struct-ctor.rs:45:11
| |
LL | m::n::Z; LL | m::n::Z;
| ^^^^^^^ | ^
error[E0603]: tuple struct `S` is private error[E0603]: tuple struct `S` is private
--> $DIR/privacy-struct-ctor.rs:51:5 --> $DIR/privacy-struct-ctor.rs:51:16
| |
LL | xcrate::m::S; LL | xcrate::m::S;
| ^^^^^^^^^^^^ | ^
error[E0603]: tuple struct `Z` is private error[E0603]: tuple struct `Z` is private
--> $DIR/privacy-struct-ctor.rs:55:5 --> $DIR/privacy-struct-ctor.rs:55:19
| |
LL | xcrate::m::n::Z; LL | xcrate::m::n::Z;
| ^^^^^^^^^^^^^^^ | ^
error: aborting due to 10 previous errors error: aborting due to 10 previous errors

View File

@ -11,16 +11,16 @@ LL | let us = UnitStruct;
| ^^^^^^^^^^ constructor is not visible here due to private fields | ^^^^^^^^^^ constructor is not visible here due to private fields
error[E0603]: tuple struct `TupleStruct` is private error[E0603]: tuple struct `TupleStruct` is private
--> $DIR/structs.rs:33:23 --> $DIR/structs.rs:33:32
| |
LL | let ts_explicit = structs::TupleStruct(640, 480); LL | let ts_explicit = structs::TupleStruct(640, 480);
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^
error[E0603]: unit struct `UnitStruct` is private error[E0603]: unit struct `UnitStruct` is private
--> $DIR/structs.rs:42:23 --> $DIR/structs.rs:42:32
| |
LL | let us_explicit = structs::UnitStruct; LL | let us_explicit = structs::UnitStruct;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^
error[E0639]: cannot create non-exhaustive struct using struct expression error[E0639]: cannot create non-exhaustive struct using struct expression
--> $DIR/structs.rs:17:14 --> $DIR/structs.rs:17:14

View File

@ -1,14 +1,14 @@
error[E0603]: module `bar` is private error[E0603]: module `bar` is private
--> $DIR/shadowed-use-visibility.rs:19:9 --> $DIR/shadowed-use-visibility.rs:19:14
| |
LL | use foo::bar::f as g; //~ ERROR module `bar` is private LL | use foo::bar::f as g; //~ ERROR module `bar` is private
| ^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `f` is private error[E0603]: module `f` is private
--> $DIR/shadowed-use-visibility.rs:25:5 --> $DIR/shadowed-use-visibility.rs:25:10
| |
LL | use bar::f::f; //~ ERROR module `f` is private LL | use bar::f::f; //~ ERROR module `f` is private
| ^^^^^^^^^ | ^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,14 +1,14 @@
error[E0603]: static `private` is private error[E0603]: static `private` is private
--> $DIR/static-priv-by-default2.rs:25:9 --> $DIR/static-priv-by-default2.rs:25:30
| |
LL | use child::childs_child::private; LL | use child::childs_child::private;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^
error[E0603]: static `private` is private error[E0603]: static `private` is private
--> $DIR/static-priv-by-default2.rs:33:9 --> $DIR/static-priv-by-default2.rs:33:33
| |
LL | use static_priv_by_default::private; LL | use static_priv_by_default::private;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,14 +1,14 @@
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy-xc.rs:14:9 --> $DIR/struct-variant-privacy-xc.rs:14:33
| |
LL | fn f(b: struct_variant_privacy::Bar) { //~ ERROR enum `Bar` is private LL | fn f(b: struct_variant_privacy::Bar) { //~ ERROR enum `Bar` is private
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy-xc.rs:16:9 --> $DIR/struct-variant-privacy-xc.rs:16:33
| |
LL | struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private LL | struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,14 +1,14 @@
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy.rs:16:9 --> $DIR/struct-variant-privacy.rs:16:14
| |
LL | fn f(b: foo::Bar) { //~ ERROR enum `Bar` is private LL | fn f(b: foo::Bar) { //~ ERROR enum `Bar` is private
| ^^^^^^^^ | ^^^
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy.rs:18:9 --> $DIR/struct-variant-privacy.rs:18:14
| |
LL | foo::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private LL | foo::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private
| ^^^^^^^^^^^^^ | ^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,8 +1,8 @@
error[E0603]: module `super_sekrit` is private error[E0603]: module `super_sekrit` is private
--> $DIR/unreachable-variant.rs:16:14 --> $DIR/unreachable-variant.rs:16:21
| |
LL | let _x = other::super_sekrit::sooper_sekrit::baz; //~ ERROR is private LL | let _x = other::super_sekrit::sooper_sekrit::baz; //~ ERROR is private
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View File

@ -41,16 +41,16 @@ LL | use use_from_trait_xc::Baz::new as baznew;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `new` in `Baz` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `new` in `Baz`
error[E0603]: struct `Foo` is private error[E0603]: struct `Foo` is private
--> $DIR/use-from-trait-xc.rs:24:5 --> $DIR/use-from-trait-xc.rs:24:24
| |
LL | use use_from_trait_xc::Foo::new; //~ ERROR struct `Foo` is private LL | use use_from_trait_xc::Foo::new; //~ ERROR struct `Foo` is private
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: struct `Foo` is private error[E0603]: struct `Foo` is private
--> $DIR/use-from-trait-xc.rs:27:5 --> $DIR/use-from-trait-xc.rs:27:24
| |
LL | use use_from_trait_xc::Foo::C; //~ ERROR struct `Foo` is private LL | use use_from_trait_xc::Foo::C; //~ ERROR struct `Foo` is private
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to 9 previous errors error: aborting due to 9 previous errors

View File

@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use foo::bar::{ use foo::bar::{ //~ ERROR module `bar` is private
self //~ ERROR module `bar` is private self
}; };
use foo::bar::{ use foo::bar::{ //~ ERROR module `bar` is private
Bar //~ ERROR module `bar` is private Bar
}; };
mod foo { mod foo {

View File

@ -1,14 +1,14 @@
error[E0603]: module `bar` is private error[E0603]: module `bar` is private
--> $DIR/use-mod-3.rs:12:5 --> $DIR/use-mod-3.rs:11:10
| |
LL | self //~ ERROR module `bar` is private LL | use foo::bar::{ //~ ERROR module `bar` is private
| ^^^^ | ^^^
error[E0603]: module `bar` is private error[E0603]: module `bar` is private
--> $DIR/use-mod-3.rs:15:5 --> $DIR/use-mod-3.rs:14:10
| |
LL | Bar //~ ERROR module `bar` is private LL | use foo::bar::{ //~ ERROR module `bar` is private
| ^^^ | ^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,62 +1,62 @@
error[E0603]: static `j` is private error[E0603]: static `j` is private
--> $DIR/xcrate-private-by-default.rs:33:5 --> $DIR/xcrate-private-by-default.rs:33:29
| |
LL | static_priv_by_default::j; LL | static_priv_by_default::j;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^
error[E0603]: function `k` is private error[E0603]: function `k` is private
--> $DIR/xcrate-private-by-default.rs:35:5 --> $DIR/xcrate-private-by-default.rs:35:29
| |
LL | static_priv_by_default::k; LL | static_priv_by_default::k;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^
error[E0603]: unit struct `l` is private error[E0603]: unit struct `l` is private
--> $DIR/xcrate-private-by-default.rs:37:5 --> $DIR/xcrate-private-by-default.rs:37:29
| |
LL | static_priv_by_default::l; LL | static_priv_by_default::l;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^
error[E0603]: enum `m` is private error[E0603]: enum `m` is private
--> $DIR/xcrate-private-by-default.rs:39:11 --> $DIR/xcrate-private-by-default.rs:39:35
| |
LL | foo::<static_priv_by_default::m>(); LL | foo::<static_priv_by_default::m>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^
error[E0603]: type alias `n` is private error[E0603]: type alias `n` is private
--> $DIR/xcrate-private-by-default.rs:41:11 --> $DIR/xcrate-private-by-default.rs:41:35
| |
LL | foo::<static_priv_by_default::n>(); LL | foo::<static_priv_by_default::n>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:45:5 --> $DIR/xcrate-private-by-default.rs:45:29
| |
LL | static_priv_by_default::foo::a; LL | static_priv_by_default::foo::a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:47:5 --> $DIR/xcrate-private-by-default.rs:47:29
| |
LL | static_priv_by_default::foo::b; LL | static_priv_by_default::foo::b;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:49:5 --> $DIR/xcrate-private-by-default.rs:49:29
| |
LL | static_priv_by_default::foo::c; LL | static_priv_by_default::foo::c;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:51:11 --> $DIR/xcrate-private-by-default.rs:51:35
| |
LL | foo::<static_priv_by_default::foo::d>(); LL | foo::<static_priv_by_default::foo::d>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:53:11 --> $DIR/xcrate-private-by-default.rs:53:35
| |
LL | foo::<static_priv_by_default::foo::e>(); LL | foo::<static_priv_by_default::foo::e>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^
error: aborting due to 10 previous errors error: aborting due to 10 previous errors