resolve: Point at the private item definitions in privacy errors
This commit is contained in:
parent
0f70daa9b0
commit
28c3f6eb40
@ -917,15 +917,21 @@ impl<'a> Resolver<'a> {
|
||||
let PrivacyError { ident, binding, .. } = *privacy_error;
|
||||
let session = &self.session;
|
||||
let mk_struct_span_error = |is_constructor| {
|
||||
struct_span_err!(
|
||||
session,
|
||||
ident.span,
|
||||
E0603,
|
||||
"{}{} `{}` is private",
|
||||
binding.res().descr(),
|
||||
if is_constructor { " constructor" } else { "" },
|
||||
ident.name,
|
||||
)
|
||||
let mut descr = binding.res().descr().to_string();
|
||||
if is_constructor {
|
||||
descr += " constructor";
|
||||
}
|
||||
|
||||
let mut err =
|
||||
struct_span_err!(session, ident.span, E0603, "{} `{}` is private", descr, ident);
|
||||
|
||||
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(
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: constant `PRIVATE` is private
|
||||
--> $DIR/E0603.rs:6:17
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -8,7 +8,13 @@ error[E0603]: constant `FOO` is private
|
||||
--> $DIR/error-festival.rs:22:10
|
||||
|
|
||||
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`
|
||||
--> $DIR/error-festival.rs:12:5
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: function `unexported` is private
|
||||
--> $DIR/export-import.rs:1:8
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: enum `Y` is private
|
||||
--> $DIR/export-tag-variant.rs:7:26
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -26,7 +26,13 @@ error[E0603]: function `z` is private
|
||||
--> $DIR/export.rs:10:18
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: crate `core` is private
|
||||
--> $DIR/extern-crate-visibility.rs:6:10
|
||||
|
|
||||
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
|
||||
--> $DIR/extern-crate-visibility.rs:9:10
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: function `f` is private
|
||||
--> $DIR/privacy.rs:16:14
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -17,7 +17,13 @@ error[E0603]: unresolved item `foo` is private
|
||||
--> $DIR/import.rs:15:10
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: struct `ParseOptions` is private
|
||||
--> $DIR/issue-55884-2.rs:12:17
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -14,13 +14,25 @@ error[E0603]: module `foo` is private
|
||||
--> $DIR/reexports.rs:33:15
|
||||
|
|
||||
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
|
||||
--> $DIR/reexports.rs:34:15
|
||||
|
|
||||
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
|
||||
--> $DIR/reexports.rs:9:17
|
||||
|
@ -38,7 +38,13 @@ error[E0603]: function `quz` is private
|
||||
--> $DIR/unresolved-imports-used.rs:9:10
|
||||
|
|
||||
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`
|
||||
--> $DIR/unresolved-imports-used.rs:16:5
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: struct `S` is private
|
||||
--> $DIR/issue-10545.rs:6:14
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: trait `Foo` is private
|
||||
--> $DIR/issue-11593.rs:7:24
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: enum `Foo` is private
|
||||
--> $DIR/issue-11680.rs:6:21
|
||||
|
|
||||
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
|
||||
--> $DIR/issue-11680.rs:9:27
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: unit struct `C` is private
|
||||
--> $DIR/issue-13407.rs:6:8
|
||||
|
|
||||
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
|
||||
--> $DIR/issue-13407.rs:6:12
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: struct `Foo` is private
|
||||
--> $DIR/issue-13641.rs:9:8
|
||||
|
|
||||
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
|
||||
--> $DIR/issue-13641.rs:11:8
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: function `bar` is private
|
||||
--> $DIR/issue-16725.rs:6:19
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: constant `B` is private
|
||||
--> $DIR/issue-17718-const-privacy.rs:5:8
|
||||
|
|
||||
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
|
||||
--> $DIR/issue-17718-const-privacy.rs:8:5
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: module `n` is private
|
||||
--> $DIR/issue-28388-2.rs:7:8
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -8,7 +8,13 @@ error[E0603]: struct `A` is private
|
||||
--> $DIR/issue-29161.rs:13:8
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -8,7 +8,13 @@ error[E0603]: module `sys` is private
|
||||
--> $DIR/issue-38857.rs:2:18
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: function `fly` is private
|
||||
--> $DIR/issue-3993.rs:1:10
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,14 @@ error[E0603]: constant `baz` is private
|
||||
--> $DIR/macro-local-data-key-priv.rs:8:10
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -13,7 +13,16 @@ error[E0603]: static `x` is private
|
||||
--> $DIR/pub-item-macro.rs:17:23
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: macro `mac` is private
|
||||
--> $DIR/decl-macro.rs:8:8
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,19 +2,37 @@ error[E0603]: module `bar` is private
|
||||
--> $DIR/privacy-in-paths.rs:24:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-in-paths.rs:25:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-in-paths.rs:26:23
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -58,19 +58,37 @@ error[E0603]: trait `Bar` is private
|
||||
--> $DIR/privacy-ns2.rs:63:15
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-ns2.rs:67:15
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-ns2.rs:74:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-ns2.rs:41:18
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: trait `Bar` is private
|
||||
--> $DIR/privacy-ufcs.rs:12:20
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,79 +2,157 @@ error[E0603]: module `baz` is private
|
||||
--> $DIR/privacy1.rs:132:18
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:132:18
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:141:18
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:165:20
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:104:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:105:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:107:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:108:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:112:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:118:20
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:127:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:128:16
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:157:17
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy1.rs:77:9
|
||||
|
@ -8,7 +8,13 @@ error[E0603]: function `foo` is private
|
||||
--> $DIR/privacy2.rs:23:20
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: module `glob` is private
|
||||
--> $DIR/privacy4.rs:21:14
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -5,7 +5,13 @@ LL | pub struct A(());
|
||||
| -- a constructor is private if any of the fields is private
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $DIR/privacy5.rs:56:12
|
||||
@ -32,7 +50,13 @@ LL | pub struct A(());
|
||||
| -- a constructor is private if any of the fields is private
|
||||
...
|
||||
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
|
||||
--> $DIR/privacy5.rs:57:12
|
||||
@ -41,7 +65,13 @@ LL | pub struct A(());
|
||||
| -- a constructor is private if any of the fields is private
|
||||
...
|
||||
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
|
||||
--> $DIR/privacy5.rs:58:18
|
||||
@ -50,7 +80,13 @@ LL | pub struct A(());
|
||||
| -- a constructor is private if any of the fields is private
|
||||
...
|
||||
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
|
||||
--> $DIR/privacy5.rs:59:18
|
||||
@ -59,7 +95,13 @@ LL | pub struct A(());
|
||||
| -- a constructor is private if any of the fields is private
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $DIR/privacy5.rs:83:17
|
||||
@ -194,7 +320,13 @@ LL | pub struct A(());
|
||||
| -- a constructor is private if any of the fields is private
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $DIR/privacy5.rs:90:20
|
||||
|
|
||||
LL | let a = other::A(());
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
||||
|
|
||||
LL | pub struct A(());
|
||||
| -- 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
|
||||
--> $DIR/privacy5.rs:91:20
|
||||
|
|
||||
LL | let b = other::B(2);
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:92:20
|
||||
|
|
||||
LL | let c = other::C(2, 3);
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:95:16
|
||||
|
|
||||
LL | let other::A(()) = a;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
||||
|
|
||||
LL | pub struct A(());
|
||||
| -- 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
|
||||
--> $DIR/privacy5.rs:96:16
|
||||
|
|
||||
LL | let other::A(_) = a;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
||||
|
|
||||
LL | pub struct A(());
|
||||
| -- 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
|
||||
--> $DIR/privacy5.rs:97:22
|
||||
|
|
||||
LL | match a { other::A(()) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
||||
|
|
||||
LL | pub struct A(());
|
||||
| -- 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
|
||||
--> $DIR/privacy5.rs:98:22
|
||||
|
|
||||
LL | match a { other::A(_) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
||||
|
|
||||
LL | pub struct A(());
|
||||
| -- 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
|
||||
--> $DIR/privacy5.rs:100:16
|
||||
|
|
||||
LL | let other::B(_) = b;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:101:16
|
||||
|
|
||||
LL | let other::B(_b) = b;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:102:22
|
||||
|
|
||||
LL | match b { other::B(_) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:103:22
|
||||
|
|
||||
LL | match b { other::B(_b) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:104:22
|
||||
|
|
||||
LL | match b { other::B(1) => {}
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:105:16
|
||||
|
|
||||
LL | other::B(_) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:107:16
|
||||
|
|
||||
LL | let other::C(_, _) = c;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:108:16
|
||||
|
|
||||
LL | let other::C(_a, _) = c;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:109:16
|
||||
|
|
||||
LL | let other::C(_, _b) = c;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:110:16
|
||||
|
|
||||
LL | let other::C(_a, _b) = c;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:111:22
|
||||
|
|
||||
LL | match c { other::C(_, _) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:112:22
|
||||
|
|
||||
LL | match c { other::C(_a, _) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:113:22
|
||||
|
|
||||
LL | match c { other::C(_, _b) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:114:22
|
||||
|
|
||||
LL | match c { other::C(_a, _b) => {} }
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
--> $DIR/privacy5.rs:122:21
|
||||
|
|
||||
LL | let a2 = other::A;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
||||
|
|
||||
LL | pub struct A(());
|
||||
| -- 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
|
||||
--> $DIR/privacy5.rs:123:21
|
||||
|
|
||||
LL | let b2 = other::B;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
||||
|
|
||||
LL | pub struct B(isize);
|
||||
| ----- 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
|
||||
--> $DIR/privacy5.rs:124:21
|
||||
|
|
||||
LL | let c2 = other::C;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
||||
|
|
||||
LL | pub struct C(pub isize, isize);
|
||||
| ---------------- 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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: function `f` is private
|
||||
--> $DIR/private-item-simple.rs:6:8
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -26,13 +26,25 @@ error[E0603]: struct `Crate` is private
|
||||
--> $DIR/test.rs:38:25
|
||||
|
|
||||
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
|
||||
--> $DIR/test.rs:30:19
|
||||
|
|
||||
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
|
||||
--> $DIR/test.rs:31:5
|
||||
|
@ -8,7 +8,13 @@ error[E0603]: derive macro `Empty` is private
|
||||
--> $DIR/disappearing-resolution.rs:11:8
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: module `super_sekrit` is private
|
||||
--> $DIR/unreachable-variant.rs:6:21
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -253,25 +253,49 @@ error[E0603]: enum `Z` is private
|
||||
--> $DIR/privacy-enum-ctor.rs:57:22
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-enum-ctor.rs:61:22
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-enum-ctor.rs:64:22
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-enum-ctor.rs:68:22
|
||||
|
|
||||
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
|
||||
--> $DIR/privacy-enum-ctor.rs:27:20
|
||||
|
@ -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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $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
|
||||
...
|
||||
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
|
||||
--> $DIR/privacy-struct-ctor.rs:41:16
|
||||
|
|
||||
LL | xcrate::m::S;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
|
||||
|
|
||||
LL | pub struct S(u8);
|
||||
| -- 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
|
||||
--> $DIR/privacy-struct-ctor.rs:45:19
|
||||
|
|
||||
LL | xcrate::m::n::Z;
|
||||
| ^
|
||||
| ^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
|
||||
|
|
||||
LL | pub(in m) struct Z(pub(in m::n) u8);
|
||||
| --------------- 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
|
||||
|
||||
|
@ -14,18 +14,30 @@ error[E0603]: tuple struct constructor `TupleStruct` is private
|
||||
--> $DIR/struct.rs:23:32
|
||||
|
|
||||
LL | let ts_explicit = structs::TupleStruct(640, 480);
|
||||
| ^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^ this tuple struct constructor is private
|
||||
|
|
||||
::: $DIR/auxiliary/structs.rs:11:24
|
||||
|
|
||||
LL | pub struct TupleStruct(pub u16, pub u16);
|
||||
| ---------------- 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
|
||||
--> $DIR/struct.rs:32:32
|
||||
|
|
||||
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
|
||||
--> $DIR/struct.rs:7:14
|
||||
|
@ -2,31 +2,61 @@ error[E0603]: tuple variant `Tuple` is private
|
||||
--> $DIR/variant.rs:11:48
|
||||
|
|
||||
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
|
||||
--> $DIR/variant.rs:14:47
|
||||
|
|
||||
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
|
||||
--> $DIR/variant.rs:18:32
|
||||
|
|
||||
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
|
||||
--> $DIR/variant.rs:20:32
|
||||
|
|
||||
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
|
||||
--> $DIR/variant.rs:26:35
|
||||
|
|
||||
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
|
||||
--> $DIR/variant.rs:8:26
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: module `bar` is private
|
||||
--> $DIR/shadowed-use-visibility.rs:9:14
|
||||
|
|
||||
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
|
||||
--> $DIR/shadowed-use-visibility.rs:15:10
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,7 +2,13 @@ error[E0603]: module `thread_info` is private
|
||||
--> $DIR/stability-in-private-module.rs:2:26
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: static `private` is private
|
||||
--> $DIR/static-priv-by-default2.rs:15:30
|
||||
|
|
||||
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
|
||||
--> $DIR/static-priv-by-default2.rs:23:33
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: enum `Bar` is private
|
||||
--> $DIR/struct-variant-privacy-xc.rs:4:33
|
||||
|
|
||||
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
|
||||
--> $DIR/struct-variant-privacy-xc.rs:6:33
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: enum `Bar` is private
|
||||
--> $DIR/struct-variant-privacy.rs:7:14
|
||||
|
|
||||
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
|
||||
--> $DIR/struct-variant-privacy.rs:9:14
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -44,13 +44,25 @@ error[E0603]: struct `Foo` is private
|
||||
--> $DIR/use-from-trait-xc.rs:14:24
|
||||
|
|
||||
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
|
||||
--> $DIR/use-from-trait-xc.rs:17:24
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,13 +2,25 @@ error[E0603]: module `bar` is private
|
||||
--> $DIR/use-mod-3.rs:1:10
|
||||
|
|
||||
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
|
||||
--> $DIR/use-mod-3.rs:4:10
|
||||
|
|
||||
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
|
||||
|
||||
|
@ -2,61 +2,121 @@ error[E0603]: static `j` is private
|
||||
--> $DIR/xcrate-private-by-default.rs:23:29
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:25:29
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:27:29
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:29:35
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:31:35
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:35:29
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:37:29
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:39:29
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:41:35
|
||||
|
|
||||
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
|
||||
--> $DIR/xcrate-private-by-default.rs:43:35
|
||||
|
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user