1
Fork 0

resolve: Point at the private item definitions in privacy errors

This commit is contained in:
Vadim Petrochenkov 2020-01-12 16:04:03 +03:00
parent 0f70daa9b0
commit 28c3f6eb40
49 changed files with 1034 additions and 154 deletions

View file

@ -917,15 +917,21 @@ impl<'a> Resolver<'a> {
let PrivacyError { ident, binding, .. } = *privacy_error; let PrivacyError { ident, binding, .. } = *privacy_error;
let session = &self.session; let session = &self.session;
let mk_struct_span_error = |is_constructor| { let mk_struct_span_error = |is_constructor| {
struct_span_err!( let mut descr = binding.res().descr().to_string();
session, if is_constructor {
ident.span, descr += " constructor";
E0603, }
"{}{} `{}` is private",
binding.res().descr(), let mut err =
if is_constructor { " constructor" } else { "" }, struct_span_err!(session, ident.span, E0603, "{} `{}` is private", descr, ident);
ident.name,
) err.span_label(ident.span, &format!("this {} is private", descr));
err.span_note(
session.source_map().def_span(binding.span),
&format!("the {} `{}` is defined here", descr, ident),
);
err
}; };
let mut err = if let NameBindingKind::Res( let mut err = if let NameBindingKind::Res(

View file

@ -2,7 +2,13 @@ error[E0603]: constant `PRIVATE` is private
--> $DIR/E0603.rs:6:17 --> $DIR/E0603.rs:6:17
| |
LL | SomeModule::PRIVATE; LL | SomeModule::PRIVATE;
| ^^^^^^^ | ^^^^^^^ this constant is private
|
note: the constant `PRIVATE` is defined here
--> $DIR/E0603.rs:2:5
|
LL | const PRIVATE: u32 = 0x_a_bad_1dea_u32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -8,7 +8,13 @@ error[E0603]: constant `FOO` is private
--> $DIR/error-festival.rs:22:10 --> $DIR/error-festival.rs:22:10
| |
LL | foo::FOO; LL | foo::FOO;
| ^^^ | ^^^ this constant is private
|
note: the constant `FOO` is defined here
--> $DIR/error-festival.rs:7:5
|
LL | const FOO: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^
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:12:5 --> $DIR/error-festival.rs:12:5

View file

@ -2,7 +2,13 @@ error[E0603]: function `unexported` is private
--> $DIR/export-import.rs:1:8 --> $DIR/export-import.rs:1:8
| |
LL | use m::unexported; LL | use m::unexported;
| ^^^^^^^^^^ | ^^^^^^^^^^ this function is private
|
note: the function `unexported` is defined here
--> $DIR/export-import.rs:7:5
|
LL | fn unexported() { }
| ^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,13 @@ error[E0603]: enum `Y` is private
--> $DIR/export-tag-variant.rs:7:26 --> $DIR/export-tag-variant.rs:7:26
| |
LL | fn main() { let z = foo::Y::Y1; } LL | fn main() { let z = foo::Y::Y1; }
| ^ | ^ this enum is private
|
note: the enum `Y` is defined here
--> $DIR/export-tag-variant.rs:4:5
|
LL | enum Y { Y1 }
| ^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -26,7 +26,13 @@ error[E0603]: function `z` is private
--> $DIR/export.rs:10:18 --> $DIR/export.rs:10:18
| |
LL | fn main() { foo::z(10); } LL | fn main() { foo::z(10); }
| ^ | ^ this function is private
|
note: the function `z` is defined here
--> $DIR/export.rs:5:5
|
LL | fn z(y: isize) { log(debug, y); }
| ^^^^^^^^^^^^^^
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -2,13 +2,25 @@ error[E0603]: crate `core` is private
--> $DIR/extern-crate-visibility.rs:6:10 --> $DIR/extern-crate-visibility.rs:6:10
| |
LL | use foo::core::cell; LL | use foo::core::cell;
| ^^^^ | ^^^^ this crate is private
|
note: the crate `core` is defined here
--> $DIR/extern-crate-visibility.rs:2:5
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^
error[E0603]: crate `core` is private error[E0603]: crate `core` is private
--> $DIR/extern-crate-visibility.rs:9:10 --> $DIR/extern-crate-visibility.rs:9:10
| |
LL | foo::core::cell::Cell::new(0); LL | foo::core::cell::Cell::new(0);
| ^^^^ | ^^^^ this crate is private
|
note: the crate `core` is defined here
--> $DIR/extern-crate-visibility.rs:2:5
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: function `f` is private
--> $DIR/privacy.rs:16:14 --> $DIR/privacy.rs:16:14
| |
LL | foo::f() LL | foo::f()
| ^ | ^ this function is private
|
note: the function `f` is defined here
--> $DIR/privacy.rs:4:5
|
LL | fn f() {}
| ^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -17,7 +17,13 @@ error[E0603]: unresolved item `foo` is private
--> $DIR/import.rs:15:10 --> $DIR/import.rs:15:10
| |
LL | zed::foo(); LL | zed::foo();
| ^^^ | ^^^ this unresolved item is private
|
note: the unresolved item `foo` is defined here
--> $DIR/import.rs:10:9
|
LL | use foo;
| ^^^
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: struct `ParseOptions` is private
--> $DIR/issue-55884-2.rs:12:17 --> $DIR/issue-55884-2.rs:12:17
| |
LL | pub use parser::ParseOptions; LL | pub use parser::ParseOptions;
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^ this struct is private
|
note: the struct `ParseOptions` is defined here
--> $DIR/issue-55884-2.rs:9:9
|
LL | use ParseOptions;
| ^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -14,13 +14,25 @@ error[E0603]: module `foo` is private
--> $DIR/reexports.rs:33:15 --> $DIR/reexports.rs:33:15
| |
LL | use b::a::foo::S; LL | use b::a::foo::S;
| ^^^ | ^^^ this module is private
|
note: the module `foo` is defined here
--> $DIR/reexports.rs:21:17
|
LL | pub use super::foo; // This is OK since the value `foo` is visible enough.
| ^^^^^^^^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/reexports.rs:34:15 --> $DIR/reexports.rs:34:15
| |
LL | use b::b::foo::S as T; LL | use b::b::foo::S as T;
| ^^^ | ^^^ this module is private
|
note: the module `foo` is defined here
--> $DIR/reexports.rs:26:17
|
LL | pub use super::*; // This is also OK since the value `foo` is visible enough.
| ^^^^^^^^
warning: glob import doesn't reexport anything because no candidate is public enough warning: glob import doesn't reexport anything because no candidate is public enough
--> $DIR/reexports.rs:9:17 --> $DIR/reexports.rs:9:17

View file

@ -38,7 +38,13 @@ error[E0603]: function `quz` is private
--> $DIR/unresolved-imports-used.rs:9:10 --> $DIR/unresolved-imports-used.rs:9:10
| |
LL | use qux::quz; LL | use qux::quz;
| ^^^ | ^^^ this function is private
|
note: the function `quz` is defined here
--> $DIR/unresolved-imports-used.rs:5:4
|
LL | fn quz() {}
| ^^^^^^^^
error: unused import: `qux::quy` error: unused import: `qux::quy`
--> $DIR/unresolved-imports-used.rs:16:5 --> $DIR/unresolved-imports-used.rs:16:5

View file

@ -2,7 +2,13 @@ error[E0603]: struct `S` is private
--> $DIR/issue-10545.rs:6:14 --> $DIR/issue-10545.rs:6:14
| |
LL | fn foo(_: a::S) { LL | fn foo(_: a::S) {
| ^ | ^ this struct is private
|
note: the struct `S` is defined here
--> $DIR/issue-10545.rs:2:5
|
LL | struct S;
| ^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,13 @@ error[E0603]: trait `Foo` is private
--> $DIR/issue-11593.rs:7:24 --> $DIR/issue-11593.rs:7:24
| |
LL | impl private_trait_xc::Foo for Bar {} LL | impl private_trait_xc::Foo for Bar {}
| ^^^ | ^^^ this trait is private
|
note: the trait `Foo` is defined here
--> $DIR/auxiliary/private-trait-xc.rs:1:1
|
LL | trait Foo {}
| ^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,13 +2,25 @@ error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:6:21 --> $DIR/issue-11680.rs:6:21
| |
LL | let _b = other::Foo::Bar(1); LL | let _b = other::Foo::Bar(1);
| ^^^ | ^^^ this enum is private
|
note: the enum `Foo` is defined here
--> $DIR/auxiliary/issue-11680.rs:1:1
|
LL | enum Foo {
| ^^^^^^^^
error[E0603]: enum `Foo` is private error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:9:27 --> $DIR/issue-11680.rs:9:27
| |
LL | let _b = other::test::Foo::Bar(1); LL | let _b = other::test::Foo::Bar(1);
| ^^^ | ^^^ this enum is private
|
note: the enum `Foo` is defined here
--> $DIR/auxiliary/issue-11680.rs:6:5
|
LL | enum Foo {
| ^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: unit struct `C` is private
--> $DIR/issue-13407.rs:6:8 --> $DIR/issue-13407.rs:6:8
| |
LL | A::C = 1; LL | A::C = 1;
| ^ | ^ this unit struct is private
|
note: the unit struct `C` is defined here
--> $DIR/issue-13407.rs:2:5
|
LL | struct C;
| ^^^^^^^^^
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-13407.rs:6:12 --> $DIR/issue-13407.rs:6:12

View file

@ -2,13 +2,25 @@ error[E0603]: struct `Foo` is private
--> $DIR/issue-13641.rs:9:8 --> $DIR/issue-13641.rs:9:8
| |
LL | a::Foo::new(); LL | a::Foo::new();
| ^^^ | ^^^ this struct is private
|
note: the struct `Foo` is defined here
--> $DIR/issue-13641.rs:2:5
|
LL | struct Foo;
| ^^^^^^^^^^^
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/issue-13641.rs:11:8 --> $DIR/issue-13641.rs:11:8
| |
LL | a::Bar::new(); LL | a::Bar::new();
| ^^^ | ^^^ this enum is private
|
note: the enum `Bar` is defined here
--> $DIR/issue-13641.rs:4:5
|
LL | enum Bar {}
| ^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: function `bar` is private
--> $DIR/issue-16725.rs:6:19 --> $DIR/issue-16725.rs:6:19
| |
LL | unsafe { foo::bar(); } LL | unsafe { foo::bar(); }
| ^^^ | ^^^ this function is private
|
note: the function `bar` is defined here
--> $DIR/auxiliary/issue-16725.rs:2:5
|
LL | fn bar();
| ^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,13 +2,25 @@ error[E0603]: constant `B` is private
--> $DIR/issue-17718-const-privacy.rs:5:8 --> $DIR/issue-17718-const-privacy.rs:5:8
| |
LL | use a::B; LL | use a::B;
| ^ | ^ this constant is private
|
note: the constant `B` is defined here
--> $DIR/issue-17718-const-privacy.rs:13:5
|
LL | const B: usize = 3;
| ^^^^^^^^^^^^^^^^^^^
error[E0603]: constant `BAR` is private error[E0603]: constant `BAR` is private
--> $DIR/issue-17718-const-privacy.rs:8:5 --> $DIR/issue-17718-const-privacy.rs:8:5
| |
LL | BAR, LL | BAR,
| ^^^ | ^^^ this constant is private
|
note: the constant `BAR` is defined here
--> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1
|
LL | const BAR: usize = 3;
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: module `n` is private
--> $DIR/issue-28388-2.rs:7:8 --> $DIR/issue-28388-2.rs:7:8
| |
LL | use m::n::{}; LL | use m::n::{};
| ^ | ^ this module is private
|
note: the module `n` is defined here
--> $DIR/issue-28388-2.rs:4:5
|
LL | mod n {}
| ^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -8,7 +8,13 @@ error[E0603]: struct `A` is private
--> $DIR/issue-29161.rs:13:8 --> $DIR/issue-29161.rs:13:8
| |
LL | a::A::default(); LL | a::A::default();
| ^ | ^ this struct is private
|
note: the struct `A` is defined here
--> $DIR/issue-29161.rs:2:5
|
LL | struct A;
| ^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -8,7 +8,13 @@ error[E0603]: module `sys` is private
--> $DIR/issue-38857.rs:2:18 --> $DIR/issue-38857.rs:2:18
| |
LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() };
| ^^^ | ^^^ this module is private
|
note: the module `sys` is defined here
--> $SRC_DIR/libstd/lib.rs:LL:COL
|
LL | mod sys;
| ^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: function `fly` is private
--> $DIR/issue-3993.rs:1:10 --> $DIR/issue-3993.rs:1:10
| |
LL | use zoo::fly; LL | use zoo::fly;
| ^^^ | ^^^ this function is private
|
note: the function `fly` is defined here
--> $DIR/issue-3993.rs:4:5
|
LL | fn fly() {}
| ^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,14 @@ error[E0603]: constant `baz` is private
--> $DIR/macro-local-data-key-priv.rs:8:10 --> $DIR/macro-local-data-key-priv.rs:8:10
| |
LL | bar::baz.with(|_| ()); LL | bar::baz.with(|_| ());
| ^^^ | ^^^ this constant is private
|
note: the constant `baz` is defined here
--> $DIR/macro-local-data-key-priv.rs:4:5
|
LL | thread_local!(static baz: f64 = 0.0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to previous error error: aborting due to previous error

View file

@ -13,7 +13,16 @@ error[E0603]: static `x` is private
--> $DIR/pub-item-macro.rs:17:23 --> $DIR/pub-item-macro.rs:17:23
| |
LL | let y: u32 = foo::x; LL | let y: u32 = foo::x;
| ^ | ^ this static is private
|
note: the static `x` is defined here
--> $DIR/pub-item-macro.rs:4:5
|
LL | static x: u32 = 0;
| ^^^^^^^^^^^^^^^^^^
...
LL | pub_x!();
| --------- in this macro invocation
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: macro `mac` is private
--> $DIR/decl-macro.rs:8:8 --> $DIR/decl-macro.rs:8:8
| |
LL | m::mac!(); LL | m::mac!();
| ^^^ | ^^^ this macro is private
|
note: the macro `mac` is defined here
--> $DIR/decl-macro.rs:4:5
|
LL | macro mac() {}
| ^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,19 +2,37 @@ error[E0603]: module `bar` is private
--> $DIR/privacy-in-paths.rs:24:16 --> $DIR/privacy-in-paths.rs:24:16
| |
LL | ::foo::bar::baz::f(); LL | ::foo::bar::baz::f();
| ^^^ | ^^^ this module is private
|
note: the module `bar` is defined here
--> $DIR/privacy-in-paths.rs:3:5
|
LL | mod bar {
| ^^^^^^^
error[E0603]: module `bar` is private error[E0603]: module `bar` is private
--> $DIR/privacy-in-paths.rs:25:16 --> $DIR/privacy-in-paths.rs:25:16
| |
LL | ::foo::bar::S::f(); LL | ::foo::bar::S::f();
| ^^^ | ^^^ this module is private
|
note: the module `bar` is defined here
--> $DIR/privacy-in-paths.rs:3:5
|
LL | mod bar {
| ^^^^^^^
error[E0603]: trait `T` is private error[E0603]: trait `T` is private
--> $DIR/privacy-in-paths.rs:26:23 --> $DIR/privacy-in-paths.rs:26:23
| |
LL | <() as ::foo::T>::Assoc::f(); LL | <() as ::foo::T>::Assoc::f();
| ^ | ^ this trait is private
|
note: the trait `T` is defined here
--> $DIR/privacy-in-paths.rs:8:5
|
LL | trait T {
| ^^^^^^^
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -58,19 +58,37 @@ error[E0603]: trait `Bar` is private
--> $DIR/privacy-ns2.rs:63:15 --> $DIR/privacy-ns2.rs:63:15
| |
LL | use foo3::Bar; LL | use foo3::Bar;
| ^^^ | ^^^ this trait is private
|
note: the trait `Bar` is defined here
--> $DIR/privacy-ns2.rs:55:5
|
LL | trait Bar {
| ^^^^^^^^^
error[E0603]: trait `Bar` is private error[E0603]: trait `Bar` is private
--> $DIR/privacy-ns2.rs:67:15 --> $DIR/privacy-ns2.rs:67:15
| |
LL | use foo3::Bar; LL | use foo3::Bar;
| ^^^ | ^^^ this trait is private
|
note: the trait `Bar` is defined here
--> $DIR/privacy-ns2.rs:55:5
|
LL | trait Bar {
| ^^^^^^^^^
error[E0603]: trait `Bar` is private error[E0603]: trait `Bar` is private
--> $DIR/privacy-ns2.rs:74:16 --> $DIR/privacy-ns2.rs:74:16
| |
LL | use foo3::{Bar,Baz}; LL | use foo3::{Bar,Baz};
| ^^^ | ^^^ this trait is private
|
note: the trait `Bar` is defined here
--> $DIR/privacy-ns2.rs:55:5
|
LL | trait Bar {
| ^^^^^^^^^
error[E0107]: wrong number of const arguments: expected 0, found 1 error[E0107]: wrong number of const arguments: expected 0, found 1
--> $DIR/privacy-ns2.rs:41:18 --> $DIR/privacy-ns2.rs:41:18

View file

@ -2,7 +2,13 @@ error[E0603]: trait `Bar` is private
--> $DIR/privacy-ufcs.rs:12:20 --> $DIR/privacy-ufcs.rs:12:20
| |
LL | <i32 as ::foo::Bar>::baz(); LL | <i32 as ::foo::Bar>::baz();
| ^^^ | ^^^ this trait is private
|
note: the trait `Bar` is defined here
--> $DIR/privacy-ufcs.rs:4:5
|
LL | trait Bar {
| ^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,79 +2,157 @@ error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:132:18 --> $DIR/privacy1.rs:132:18
| |
LL | use bar::baz::{foo, bar}; LL | use bar::baz::{foo, bar};
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:132:18 --> $DIR/privacy1.rs:132:18
| |
LL | use bar::baz::{foo, bar}; LL | use bar::baz::{foo, bar};
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:141:18 --> $DIR/privacy1.rs:141:18
| |
LL | use bar::baz; LL | use bar::baz;
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: module `i` is private error[E0603]: module `i` is private
--> $DIR/privacy1.rs:165:20 --> $DIR/privacy1.rs:165:20
| |
LL | use self::foo::i::A; LL | use self::foo::i::A;
| ^ | ^ this module is private
|
note: the module `i` is defined here
--> $DIR/privacy1.rs:170:9
|
LL | mod i {
| ^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:104:16 --> $DIR/privacy1.rs:104:16
| |
LL | ::bar::baz::A::foo(); LL | ::bar::baz::A::foo();
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:105:16 --> $DIR/privacy1.rs:105:16
| |
LL | ::bar::baz::A::bar(); LL | ::bar::baz::A::bar();
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:107:16 --> $DIR/privacy1.rs:107:16
| |
LL | ::bar::baz::A.foo2(); LL | ::bar::baz::A.foo2();
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:108:16 --> $DIR/privacy1.rs:108:16
| |
LL | ::bar::baz::A.bar2(); LL | ::bar::baz::A.bar2();
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: trait `B` is private error[E0603]: trait `B` is private
--> $DIR/privacy1.rs:112:16 --> $DIR/privacy1.rs:112:16
| |
LL | ::bar::B::foo(); LL | ::bar::B::foo();
| ^ | ^ this trait is private
|
note: the trait `B` is defined here
--> $DIR/privacy1.rs:40:5
|
LL | trait B {
| ^^^^^^^
error[E0603]: function `epriv` is private error[E0603]: function `epriv` is private
--> $DIR/privacy1.rs:118:20 --> $DIR/privacy1.rs:118:20
| |
LL | ::bar::epriv(); LL | ::bar::epriv();
| ^^^^^ | ^^^^^ this function is private
|
note: the function `epriv` is defined here
--> $DIR/privacy1.rs:65:9
|
LL | fn epriv();
| ^^^^^^^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:127:16 --> $DIR/privacy1.rs:127:16
| |
LL | ::bar::baz::foo(); LL | ::bar::baz::foo();
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: module `baz` is private error[E0603]: module `baz` is private
--> $DIR/privacy1.rs:128:16 --> $DIR/privacy1.rs:128:16
| |
LL | ::bar::baz::bar(); LL | ::bar::baz::bar();
| ^^^ | ^^^ this module is private
|
note: the module `baz` is defined here
--> $DIR/privacy1.rs:50:5
|
LL | mod baz {
| ^^^^^^^
error[E0603]: trait `B` is private error[E0603]: trait `B` is private
--> $DIR/privacy1.rs:157:17 --> $DIR/privacy1.rs:157:17
| |
LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } } LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } }
| ^ | ^ this trait is private
|
note: the trait `B` is defined here
--> $DIR/privacy1.rs:40:5
|
LL | trait B {
| ^^^^^^^
error[E0624]: method `bar` is private error[E0624]: method `bar` is private
--> $DIR/privacy1.rs:77:9 --> $DIR/privacy1.rs:77:9

View file

@ -8,7 +8,13 @@ error[E0603]: function `foo` is private
--> $DIR/privacy2.rs:23:20 --> $DIR/privacy2.rs:23:20
| |
LL | use bar::glob::foo; LL | use bar::glob::foo;
| ^^^ | ^^^ this function is private
|
note: the function `foo` is defined here
--> $DIR/privacy2.rs:10:13
|
LL | use foo;
| ^^^
error: requires `sized` lang_item error: requires `sized` lang_item

View file

@ -2,7 +2,13 @@ error[E0603]: module `glob` is private
--> $DIR/privacy4.rs:21:14 --> $DIR/privacy4.rs:21:14
| |
LL | use bar::glob::gpriv; LL | use bar::glob::gpriv;
| ^^^^ | ^^^^ this module is private
|
note: the module `glob` is defined here
--> $DIR/privacy4.rs:13:5
|
LL | mod glob {
| ^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -5,7 +5,13 @@ LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | let a = a::A(()); LL | let a = a::A(());
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/privacy5.rs:6:5
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:52:16 --> $DIR/privacy5.rs:52:16
@ -14,7 +20,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | let b = a::B(2); LL | let b = a::B(2);
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:53:16 --> $DIR/privacy5.rs:53:16
@ -23,7 +35,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | let c = a::C(2, 3); LL | let c = a::C(2, 3);
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:56:12 --> $DIR/privacy5.rs:56:12
@ -32,7 +50,13 @@ LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | let a::A(()) = a; LL | let a::A(()) = a;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/privacy5.rs:6:5
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:57:12 --> $DIR/privacy5.rs:57:12
@ -41,7 +65,13 @@ LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | let a::A(_) = a; LL | let a::A(_) = a;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/privacy5.rs:6:5
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:58:18 --> $DIR/privacy5.rs:58:18
@ -50,7 +80,13 @@ LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | match a { a::A(()) => {} } LL | match a { a::A(()) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/privacy5.rs:6:5
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:59:18 --> $DIR/privacy5.rs:59:18
@ -59,7 +95,13 @@ LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | match a { a::A(_) => {} } LL | match a { a::A(_) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/privacy5.rs:6:5
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:61:12 --> $DIR/privacy5.rs:61:12
@ -68,7 +110,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | let a::B(_) = b; LL | let a::B(_) = b;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:62:12 --> $DIR/privacy5.rs:62:12
@ -77,7 +125,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | let a::B(_b) = b; LL | let a::B(_b) = b;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:63:18 --> $DIR/privacy5.rs:63:18
@ -86,7 +140,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | match b { a::B(_) => {} } LL | match b { a::B(_) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:64:18 --> $DIR/privacy5.rs:64:18
@ -95,7 +155,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | match b { a::B(_b) => {} } LL | match b { a::B(_b) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:65:18 --> $DIR/privacy5.rs:65:18
@ -104,7 +170,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | match b { a::B(1) => {} a::B(_) => {} } LL | match b { a::B(1) => {} a::B(_) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:65:32 --> $DIR/privacy5.rs:65:32
@ -113,7 +185,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | match b { a::B(1) => {} a::B(_) => {} } LL | match b { a::B(1) => {} a::B(_) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:68:12 --> $DIR/privacy5.rs:68:12
@ -122,7 +200,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | let a::C(_, _) = c; LL | let a::C(_, _) = c;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:69:12 --> $DIR/privacy5.rs:69:12
@ -131,7 +215,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | let a::C(_a, _) = c; LL | let a::C(_a, _) = c;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:70:12 --> $DIR/privacy5.rs:70:12
@ -140,7 +230,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | let a::C(_, _b) = c; LL | let a::C(_, _b) = c;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:71:12 --> $DIR/privacy5.rs:71:12
@ -149,7 +245,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | let a::C(_a, _b) = c; LL | let a::C(_a, _b) = c;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:72:18 --> $DIR/privacy5.rs:72:18
@ -158,7 +260,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | match c { a::C(_, _) => {} } LL | match c { a::C(_, _) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:73:18 --> $DIR/privacy5.rs:73:18
@ -167,7 +275,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | match c { a::C(_a, _) => {} } LL | match c { a::C(_a, _) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:74:18 --> $DIR/privacy5.rs:74:18
@ -176,7 +290,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | match c { a::C(_, _b) => {} } LL | match c { a::C(_, _b) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:75:18 --> $DIR/privacy5.rs:75:18
@ -185,7 +305,13 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | match c { a::C(_a, _b) => {} } LL | match c { a::C(_a, _b) => {} }
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:83:17 --> $DIR/privacy5.rs:83:17
@ -194,7 +320,13 @@ LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | let a2 = a::A; LL | let a2 = a::A;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/privacy5.rs:6:5
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:84:17 --> $DIR/privacy5.rs:84:17
@ -203,7 +335,13 @@ LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
... ...
LL | let b2 = a::B; LL | let b2 = a::B;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/privacy5.rs:7:5
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:85:17 --> $DIR/privacy5.rs:85:17
@ -212,271 +350,421 @@ LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
... ...
LL | let c2 = a::C; LL | let c2 = a::C;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/privacy5.rs:8:5
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:90:20 --> $DIR/privacy5.rs:90:20
| |
LL | let a = other::A(()); LL | let a = other::A(());
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
| |
LL | pub struct A(()); LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:91:20 --> $DIR/privacy5.rs:91:20
| |
LL | let b = other::B(2); LL | let b = other::B(2);
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:92:20 --> $DIR/privacy5.rs:92:20
| |
LL | let c = other::C(2, 3); LL | let c = other::C(2, 3);
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:95:16 --> $DIR/privacy5.rs:95:16
| |
LL | let other::A(()) = a; LL | let other::A(()) = a;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
| |
LL | pub struct A(()); LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:96:16 --> $DIR/privacy5.rs:96:16
| |
LL | let other::A(_) = a; LL | let other::A(_) = a;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
| |
LL | pub struct A(()); LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:97:22 --> $DIR/privacy5.rs:97:22
| |
LL | match a { other::A(()) => {} } LL | match a { other::A(()) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
| |
LL | pub struct A(()); LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:98:22 --> $DIR/privacy5.rs:98:22
| |
LL | match a { other::A(_) => {} } LL | match a { other::A(_) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
| |
LL | pub struct A(()); LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:100:16 --> $DIR/privacy5.rs:100:16
| |
LL | let other::B(_) = b; LL | let other::B(_) = b;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:101:16 --> $DIR/privacy5.rs:101:16
| |
LL | let other::B(_b) = b; LL | let other::B(_b) = b;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:102:22 --> $DIR/privacy5.rs:102:22
| |
LL | match b { other::B(_) => {} } LL | match b { other::B(_) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:103:22 --> $DIR/privacy5.rs:103:22
| |
LL | match b { other::B(_b) => {} } LL | match b { other::B(_b) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:104:22 --> $DIR/privacy5.rs:104:22
| |
LL | match b { other::B(1) => {} LL | match b { other::B(1) => {}
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:105:16 --> $DIR/privacy5.rs:105:16
| |
LL | other::B(_) => {} } LL | other::B(_) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:107:16 --> $DIR/privacy5.rs:107:16
| |
LL | let other::C(_, _) = c; LL | let other::C(_, _) = c;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:108:16 --> $DIR/privacy5.rs:108:16
| |
LL | let other::C(_a, _) = c; LL | let other::C(_a, _) = c;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:109:16 --> $DIR/privacy5.rs:109:16
| |
LL | let other::C(_, _b) = c; LL | let other::C(_, _b) = c;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:110:16 --> $DIR/privacy5.rs:110:16
| |
LL | let other::C(_a, _b) = c; LL | let other::C(_a, _b) = c;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:111:22 --> $DIR/privacy5.rs:111:22
| |
LL | match c { other::C(_, _) => {} } LL | match c { other::C(_, _) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:112:22 --> $DIR/privacy5.rs:112:22
| |
LL | match c { other::C(_a, _) => {} } LL | match c { other::C(_a, _) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:113:22 --> $DIR/privacy5.rs:113:22
| |
LL | match c { other::C(_, _b) => {} } LL | match c { other::C(_, _b) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:114:22 --> $DIR/privacy5.rs:114:22
| |
LL | match c { other::C(_a, _b) => {} } LL | match c { other::C(_a, _b) => {} }
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `A` is private error[E0603]: tuple struct constructor `A` is private
--> $DIR/privacy5.rs:122:21 --> $DIR/privacy5.rs:122:21
| |
LL | let a2 = other::A; LL | let a2 = other::A;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
| |
LL | pub struct A(()); LL | pub struct A(());
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `A` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:1:1
|
LL | pub struct A(());
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `B` is private error[E0603]: tuple struct constructor `B` is private
--> $DIR/privacy5.rs:123:21 --> $DIR/privacy5.rs:123:21
| |
LL | let b2 = other::B; LL | let b2 = other::B;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
| |
LL | pub struct B(isize); LL | pub struct B(isize);
| ----- a constructor is private if any of the fields is private | ----- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `B` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:2:1
|
LL | pub struct B(isize);
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `C` is private error[E0603]: tuple struct constructor `C` is private
--> $DIR/privacy5.rs:124:21 --> $DIR/privacy5.rs:124:21
| |
LL | let c2 = other::C; LL | let c2 = other::C;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
| |
LL | pub struct C(pub isize, isize); LL | pub struct C(pub isize, isize);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `C` is defined here
--> $DIR/auxiliary/privacy_tuple_struct.rs:3:1
|
LL | pub struct C(pub isize, isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 48 previous errors error: aborting due to 48 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: function `f` is private
--> $DIR/private-item-simple.rs:6:8 --> $DIR/private-item-simple.rs:6:8
| |
LL | a::f(); LL | a::f();
| ^ | ^ this function is private
|
note: the function `f` is defined here
--> $DIR/private-item-simple.rs:2:5
|
LL | fn f() {}
| ^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -26,13 +26,25 @@ error[E0603]: struct `Crate` is private
--> $DIR/test.rs:38:25 --> $DIR/test.rs:38:25
| |
LL | use pub_restricted::Crate; LL | use pub_restricted::Crate;
| ^^^^^ | ^^^^^ this struct is private
|
note: the struct `Crate` is defined here
--> $DIR/auxiliary/pub_restricted.rs:3:1
|
LL | pub(crate) struct Crate;
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: function `f` is private error[E0603]: function `f` is private
--> $DIR/test.rs:30:19 --> $DIR/test.rs:30:19
| |
LL | use foo::bar::f; LL | use foo::bar::f;
| ^ | ^ this function is private
|
note: the function `f` is defined here
--> $DIR/test.rs:8:9
|
LL | pub(super) fn f() {}
| ^^^^^^^^^^^^^^^^^
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:31:5 --> $DIR/test.rs:31:5

View file

@ -8,7 +8,13 @@ error[E0603]: derive macro `Empty` is private
--> $DIR/disappearing-resolution.rs:11:8 --> $DIR/disappearing-resolution.rs:11:8
| |
LL | use m::Empty; LL | use m::Empty;
| ^^^^^ | ^^^^^ this derive macro is private
|
note: the derive macro `Empty` is defined here
--> $DIR/disappearing-resolution.rs:9:9
|
LL | use test_macros::Empty;
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: module `super_sekrit` is private
--> $DIR/unreachable-variant.rs:6:21 --> $DIR/unreachable-variant.rs:6:21
| |
LL | let _x = other::super_sekrit::sooper_sekrit::baz; LL | let _x = other::super_sekrit::sooper_sekrit::baz;
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^ this module is private
|
note: the module `super_sekrit` is defined here
--> $DIR/auxiliary/unreachable_variant.rs:1:1
|
LL | mod super_sekrit {
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -253,25 +253,49 @@ error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:57:22 --> $DIR/privacy-enum-ctor.rs:57:22
| |
LL | let _: Z = m::n::Z; LL | let _: Z = m::n::Z;
| ^ | ^ this enum is private
|
note: the enum `Z` is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
|
LL | pub(in m) enum Z {
| ^^^^^^^^^^^^^^^^
error[E0603]: enum `Z` is private error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:61:22 --> $DIR/privacy-enum-ctor.rs:61:22
| |
LL | let _: Z = m::n::Z::Fn; LL | let _: Z = m::n::Z::Fn;
| ^ | ^ this enum is private
|
note: the enum `Z` is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
|
LL | pub(in m) enum Z {
| ^^^^^^^^^^^^^^^^
error[E0603]: enum `Z` is private error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:64:22 --> $DIR/privacy-enum-ctor.rs:64:22
| |
LL | let _: Z = m::n::Z::Struct; LL | let _: Z = m::n::Z::Struct;
| ^ | ^ this enum is private
|
note: the enum `Z` is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
|
LL | pub(in m) enum Z {
| ^^^^^^^^^^^^^^^^
error[E0603]: enum `Z` is private error[E0603]: enum `Z` is private
--> $DIR/privacy-enum-ctor.rs:68:22 --> $DIR/privacy-enum-ctor.rs:68:22
| |
LL | let _: Z = m::n::Z::Unit {}; LL | let _: Z = m::n::Z::Unit {};
| ^ | ^ this enum is private
|
note: the enum `Z` is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
|
LL | pub(in m) enum Z {
| ^^^^^^^^^^^^^^^^
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/privacy-enum-ctor.rs:27:20 --> $DIR/privacy-enum-ctor.rs:27:20

View file

@ -45,7 +45,13 @@ LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private | --------------- a constructor is private if any of the fields is private
... ...
LL | n::Z; LL | n::Z;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `Z` is defined here
--> $DIR/privacy-struct-ctor.rs:12:9
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `S` is private error[E0603]: tuple struct constructor `S` is private
--> $DIR/privacy-struct-ctor.rs:29:8 --> $DIR/privacy-struct-ctor.rs:29:8
@ -54,7 +60,13 @@ LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | m::S; LL | m::S;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `S` is defined here
--> $DIR/privacy-struct-ctor.rs:6:5
|
LL | pub struct S(u8);
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `S` is private error[E0603]: tuple struct constructor `S` is private
--> $DIR/privacy-struct-ctor.rs:31:19 --> $DIR/privacy-struct-ctor.rs:31:19
@ -63,7 +75,13 @@ LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
... ...
LL | let _: S = m::S(2); LL | let _: S = m::S(2);
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `S` is defined here
--> $DIR/privacy-struct-ctor.rs:6:5
|
LL | pub struct S(u8);
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `Z` is private error[E0603]: tuple struct constructor `Z` is private
--> $DIR/privacy-struct-ctor.rs:35:11 --> $DIR/privacy-struct-ctor.rs:35:11
@ -72,29 +90,47 @@ LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private | --------------- a constructor is private if any of the fields is private
... ...
LL | m::n::Z; LL | m::n::Z;
| ^ | ^ this tuple struct constructor is private
|
note: the tuple struct constructor `Z` is defined here
--> $DIR/privacy-struct-ctor.rs:12:9
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `S` is private error[E0603]: tuple struct constructor `S` is private
--> $DIR/privacy-struct-ctor.rs:41:16 --> $DIR/privacy-struct-ctor.rs:41:16
| |
LL | xcrate::m::S; LL | xcrate::m::S;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18 ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
| |
LL | pub struct S(u8); LL | pub struct S(u8);
| -- a constructor is private if any of the fields is private | -- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `S` is defined here
--> $DIR/auxiliary/privacy-struct-ctor.rs:2:5
|
LL | pub struct S(u8);
| ^^^^^^^^^^^^^^^^^
error[E0603]: tuple struct constructor `Z` is private error[E0603]: tuple struct constructor `Z` is private
--> $DIR/privacy-struct-ctor.rs:45:19 --> $DIR/privacy-struct-ctor.rs:45:19
| |
LL | xcrate::m::n::Z; LL | xcrate::m::n::Z;
| ^ | ^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28 ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
| |
LL | pub(in m) struct Z(pub(in m::n) u8); LL | pub(in m) struct Z(pub(in m::n) u8);
| --------------- a constructor is private if any of the fields is private | --------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `Z` is defined here
--> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
|
LL | pub(in m) struct Z(pub(in m::n) u8);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 10 previous errors error: aborting due to 10 previous errors

View file

@ -14,18 +14,30 @@ error[E0603]: tuple struct constructor `TupleStruct` is private
--> $DIR/struct.rs:23:32 --> $DIR/struct.rs:23:32
| |
LL | let ts_explicit = structs::TupleStruct(640, 480); LL | let ts_explicit = structs::TupleStruct(640, 480);
| ^^^^^^^^^^^ | ^^^^^^^^^^^ this tuple struct constructor is private
| |
::: $DIR/auxiliary/structs.rs:11:24 ::: $DIR/auxiliary/structs.rs:11:24
| |
LL | pub struct TupleStruct(pub u16, pub u16); LL | pub struct TupleStruct(pub u16, pub u16);
| ---------------- a constructor is private if any of the fields is private | ---------------- a constructor is private if any of the fields is private
|
note: the tuple struct constructor `TupleStruct` is defined here
--> $DIR/auxiliary/structs.rs:11:1
|
LL | pub struct TupleStruct(pub u16, pub u16);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: unit struct `UnitStruct` is private error[E0603]: unit struct `UnitStruct` is private
--> $DIR/struct.rs:32:32 --> $DIR/struct.rs:32:32
| |
LL | let us_explicit = structs::UnitStruct; LL | let us_explicit = structs::UnitStruct;
| ^^^^^^^^^^ | ^^^^^^^^^^ this unit struct is private
|
note: the unit struct `UnitStruct` is defined here
--> $DIR/auxiliary/structs.rs:8:1
|
LL | pub struct UnitStruct;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0639]: cannot create non-exhaustive struct using struct expression error[E0639]: cannot create non-exhaustive struct using struct expression
--> $DIR/struct.rs:7:14 --> $DIR/struct.rs:7:14

View file

@ -2,31 +2,61 @@ error[E0603]: tuple variant `Tuple` is private
--> $DIR/variant.rs:11:48 --> $DIR/variant.rs:11:48
| |
LL | let variant_tuple = NonExhaustiveVariants::Tuple(640); LL | let variant_tuple = NonExhaustiveVariants::Tuple(640);
| ^^^^^ | ^^^^^ this tuple variant is private
|
note: the tuple variant `Tuple` is defined here
--> $DIR/auxiliary/variants.rs:5:23
|
LL | #[non_exhaustive] Tuple(u32),
| ^^^^^^^^^^
error[E0603]: unit variant `Unit` is private error[E0603]: unit variant `Unit` is private
--> $DIR/variant.rs:14:47 --> $DIR/variant.rs:14:47
| |
LL | let variant_unit = NonExhaustiveVariants::Unit; LL | let variant_unit = NonExhaustiveVariants::Unit;
| ^^^^ | ^^^^ this unit variant is private
|
note: the unit variant `Unit` is defined here
--> $DIR/auxiliary/variants.rs:4:23
|
LL | #[non_exhaustive] Unit,
| ^^^^
error[E0603]: unit variant `Unit` is private error[E0603]: unit variant `Unit` is private
--> $DIR/variant.rs:18:32 --> $DIR/variant.rs:18:32
| |
LL | NonExhaustiveVariants::Unit => "", LL | NonExhaustiveVariants::Unit => "",
| ^^^^ | ^^^^ this unit variant is private
|
note: the unit variant `Unit` is defined here
--> $DIR/auxiliary/variants.rs:4:23
|
LL | #[non_exhaustive] Unit,
| ^^^^
error[E0603]: tuple variant `Tuple` is private error[E0603]: tuple variant `Tuple` is private
--> $DIR/variant.rs:20:32 --> $DIR/variant.rs:20:32
| |
LL | NonExhaustiveVariants::Tuple(fe_tpl) => "", LL | NonExhaustiveVariants::Tuple(fe_tpl) => "",
| ^^^^^ | ^^^^^ this tuple variant is private
|
note: the tuple variant `Tuple` is defined here
--> $DIR/auxiliary/variants.rs:5:23
|
LL | #[non_exhaustive] Tuple(u32),
| ^^^^^^^^^^
error[E0603]: tuple variant `Tuple` is private error[E0603]: tuple variant `Tuple` is private
--> $DIR/variant.rs:26:35 --> $DIR/variant.rs:26:35
| |
LL | if let NonExhaustiveVariants::Tuple(fe_tpl) = variant_struct { LL | if let NonExhaustiveVariants::Tuple(fe_tpl) = variant_struct {
| ^^^^^ | ^^^^^ this tuple variant is private
|
note: the tuple variant `Tuple` is defined here
--> $DIR/auxiliary/variants.rs:5:23
|
LL | #[non_exhaustive] Tuple(u32),
| ^^^^^^^^^^
error[E0639]: cannot create non-exhaustive variant using struct expression error[E0639]: cannot create non-exhaustive variant using struct expression
--> $DIR/variant.rs:8:26 --> $DIR/variant.rs:8:26

View file

@ -2,13 +2,25 @@ error[E0603]: module `bar` is private
--> $DIR/shadowed-use-visibility.rs:9:14 --> $DIR/shadowed-use-visibility.rs:9:14
| |
LL | use foo::bar::f as g; LL | use foo::bar::f as g;
| ^^^ | ^^^ this module is private
|
note: the module `bar` is defined here
--> $DIR/shadowed-use-visibility.rs:4:9
|
LL | use foo as bar;
| ^^^^^^^^^^
error[E0603]: module `f` is private error[E0603]: module `f` is private
--> $DIR/shadowed-use-visibility.rs:15:10 --> $DIR/shadowed-use-visibility.rs:15:10
| |
LL | use bar::f::f; LL | use bar::f::f;
| ^ | ^ this module is private
|
note: the module `f` is defined here
--> $DIR/shadowed-use-visibility.rs:11:9
|
LL | use foo as f;
| ^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,13 @@ error[E0603]: module `thread_info` is private
--> $DIR/stability-in-private-module.rs:2:26 --> $DIR/stability-in-private-module.rs:2:26
| |
LL | let _ = std::thread::thread_info::current_thread(); LL | let _ = std::thread::thread_info::current_thread();
| ^^^^^^^^^^^ | ^^^^^^^^^^^ this module is private
|
note: the module `thread_info` is defined here
--> $SRC_DIR/libstd/thread/mod.rs:LL:COL
|
LL | use crate::sys_common::thread_info;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,13 +2,25 @@ error[E0603]: static `private` is private
--> $DIR/static-priv-by-default2.rs:15:30 --> $DIR/static-priv-by-default2.rs:15:30
| |
LL | use child::childs_child::private; LL | use child::childs_child::private;
| ^^^^^^^ | ^^^^^^^ this static is private
|
note: the static `private` is defined here
--> $DIR/static-priv-by-default2.rs:7:9
|
LL | static private: isize = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0603]: static `private` is private error[E0603]: static `private` is private
--> $DIR/static-priv-by-default2.rs:23:33 --> $DIR/static-priv-by-default2.rs:23:33
| |
LL | use static_priv_by_default::private; LL | use static_priv_by_default::private;
| ^^^^^^^ | ^^^^^^^ this static is private
|
note: the static `private` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:3:1
|
LL | static private: isize = 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,13 +2,25 @@ error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy-xc.rs:4:33 --> $DIR/struct-variant-privacy-xc.rs:4:33
| |
LL | fn f(b: struct_variant_privacy::Bar) { LL | fn f(b: struct_variant_privacy::Bar) {
| ^^^ | ^^^ this enum is private
|
note: the enum `Bar` is defined here
--> $DIR/auxiliary/struct_variant_privacy.rs:1:1
|
LL | enum Bar {
| ^^^^^^^^
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy-xc.rs:6:33 --> $DIR/struct-variant-privacy-xc.rs:6:33
| |
LL | struct_variant_privacy::Bar::Baz { a: _a } => {} LL | struct_variant_privacy::Bar::Baz { a: _a } => {}
| ^^^ | ^^^ this enum is private
|
note: the enum `Bar` is defined here
--> $DIR/auxiliary/struct_variant_privacy.rs:1:1
|
LL | enum Bar {
| ^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,13 +2,25 @@ error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy.rs:7:14 --> $DIR/struct-variant-privacy.rs:7:14
| |
LL | fn f(b: foo::Bar) { LL | fn f(b: foo::Bar) {
| ^^^ | ^^^ this enum is private
|
note: the enum `Bar` is defined here
--> $DIR/struct-variant-privacy.rs:2:5
|
LL | enum Bar {
| ^^^^^^^^
error[E0603]: enum `Bar` is private error[E0603]: enum `Bar` is private
--> $DIR/struct-variant-privacy.rs:9:14 --> $DIR/struct-variant-privacy.rs:9:14
| |
LL | foo::Bar::Baz { a: _a } => {} LL | foo::Bar::Baz { a: _a } => {}
| ^^^ | ^^^ this enum is private
|
note: the enum `Bar` is defined here
--> $DIR/struct-variant-privacy.rs:2:5
|
LL | enum Bar {
| ^^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -44,13 +44,25 @@ error[E0603]: struct `Foo` is private
--> $DIR/use-from-trait-xc.rs:14:24 --> $DIR/use-from-trait-xc.rs:14:24
| |
LL | use use_from_trait_xc::Foo::new; LL | use use_from_trait_xc::Foo::new;
| ^^^ | ^^^ this struct is private
|
note: the struct `Foo` is defined here
--> $DIR/auxiliary/use-from-trait-xc.rs:9:1
|
LL | struct Foo;
| ^^^^^^^^^^^
error[E0603]: struct `Foo` is private error[E0603]: struct `Foo` is private
--> $DIR/use-from-trait-xc.rs:17:24 --> $DIR/use-from-trait-xc.rs:17:24
| |
LL | use use_from_trait_xc::Foo::C; LL | use use_from_trait_xc::Foo::C;
| ^^^ | ^^^ this struct is private
|
note: the struct `Foo` is defined here
--> $DIR/auxiliary/use-from-trait-xc.rs:9:1
|
LL | struct Foo;
| ^^^^^^^^^^^
error: aborting due to 9 previous errors error: aborting due to 9 previous errors

View file

@ -2,13 +2,25 @@ error[E0603]: module `bar` is private
--> $DIR/use-mod-3.rs:1:10 --> $DIR/use-mod-3.rs:1:10
| |
LL | use foo::bar::{ LL | use foo::bar::{
| ^^^ | ^^^ this module is private
|
note: the module `bar` is defined here
--> $DIR/use-mod-3.rs:9:5
|
LL | mod bar { pub type Bar = isize; }
| ^^^^^^^
error[E0603]: module `bar` is private error[E0603]: module `bar` is private
--> $DIR/use-mod-3.rs:4:10 --> $DIR/use-mod-3.rs:4:10
| |
LL | use foo::bar::{ LL | use foo::bar::{
| ^^^ | ^^^ this module is private
|
note: the module `bar` is defined here
--> $DIR/use-mod-3.rs:9:5
|
LL | mod bar { pub type Bar = isize; }
| ^^^^^^^
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,61 +2,121 @@ error[E0603]: static `j` is private
--> $DIR/xcrate-private-by-default.rs:23:29 --> $DIR/xcrate-private-by-default.rs:23:29
| |
LL | static_priv_by_default::j; LL | static_priv_by_default::j;
| ^ | ^ this static is private
|
note: the static `j` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:47:1
|
LL | static j: isize = 0;
| ^^^^^^^^^^^^^^^^^^^^
error[E0603]: function `k` is private error[E0603]: function `k` is private
--> $DIR/xcrate-private-by-default.rs:25:29 --> $DIR/xcrate-private-by-default.rs:25:29
| |
LL | static_priv_by_default::k; LL | static_priv_by_default::k;
| ^ | ^ this function is private
|
note: the function `k` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:48:1
|
LL | fn k() {}
| ^^^^^^
error[E0603]: unit struct `l` is private error[E0603]: unit struct `l` is private
--> $DIR/xcrate-private-by-default.rs:27:29 --> $DIR/xcrate-private-by-default.rs:27:29
| |
LL | static_priv_by_default::l; LL | static_priv_by_default::l;
| ^ | ^ this unit struct is private
|
note: the unit struct `l` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:49:1
|
LL | struct l;
| ^^^^^^^^^
error[E0603]: enum `m` is private error[E0603]: enum `m` is private
--> $DIR/xcrate-private-by-default.rs:29:35 --> $DIR/xcrate-private-by-default.rs:29:35
| |
LL | foo::<static_priv_by_default::m>(); LL | foo::<static_priv_by_default::m>();
| ^ | ^ this enum is private
|
note: the enum `m` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:50:1
|
LL | enum m {}
| ^^^^^^
error[E0603]: type alias `n` is private error[E0603]: type alias `n` is private
--> $DIR/xcrate-private-by-default.rs:31:35 --> $DIR/xcrate-private-by-default.rs:31:35
| |
LL | foo::<static_priv_by_default::n>(); LL | foo::<static_priv_by_default::n>();
| ^ | ^ this type alias is private
|
note: the type alias `n` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:51:1
|
LL | type n = isize;
| ^^^^^^^^^^^^^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:35:29 --> $DIR/xcrate-private-by-default.rs:35:29
| |
LL | static_priv_by_default::foo::a; LL | static_priv_by_default::foo::a;
| ^^^ | ^^^ this module is private
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
|
LL | mod foo {
| ^^^^^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:37:29 --> $DIR/xcrate-private-by-default.rs:37:29
| |
LL | static_priv_by_default::foo::b; LL | static_priv_by_default::foo::b;
| ^^^ | ^^^ this module is private
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
|
LL | mod foo {
| ^^^^^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:39:29 --> $DIR/xcrate-private-by-default.rs:39:29
| |
LL | static_priv_by_default::foo::c; LL | static_priv_by_default::foo::c;
| ^^^ | ^^^ this module is private
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
|
LL | mod foo {
| ^^^^^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:41:35 --> $DIR/xcrate-private-by-default.rs:41:35
| |
LL | foo::<static_priv_by_default::foo::d>(); LL | foo::<static_priv_by_default::foo::d>();
| ^^^ | ^^^ this module is private
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
|
LL | mod foo {
| ^^^^^^^
error[E0603]: module `foo` is private error[E0603]: module `foo` is private
--> $DIR/xcrate-private-by-default.rs:43:35 --> $DIR/xcrate-private-by-default.rs:43:35
| |
LL | foo::<static_priv_by_default::foo::e>(); LL | foo::<static_priv_by_default::foo::e>();
| ^^^ | ^^^ this module is private
|
note: the module `foo` is defined here
--> $DIR/auxiliary/static_priv_by_default.rs:12:1
|
LL | mod foo {
| ^^^^^^^
error: aborting due to 10 previous errors error: aborting due to 10 previous errors