diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/privacy/access_levels.rs | 33 | ||||
| -rw-r--r-- | src/test/ui/privacy/access_levels.stderr | 40 |
2 files changed, 33 insertions, 40 deletions
diff --git a/src/test/ui/privacy/access_levels.rs b/src/test/ui/privacy/access_levels.rs index bf94d980678..cc074a4f958 100644 --- a/src/test/ui/privacy/access_levels.rs +++ b/src/test/ui/privacy/access_levels.rs @@ -1,44 +1,44 @@ #![feature(rustc_attrs)] #[rustc_effective_visibility] -mod outer { //~ ERROR Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) +mod outer { //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate) #[rustc_effective_visibility] - pub mod inner1 { //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + pub mod inner1 { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] - extern "C" {} //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + extern "C" {} //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] - pub trait PubTrait { //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + pub trait PubTrait { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] - const A: i32; //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + const A: i32; //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] - type B; //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + type B; //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub } #[rustc_effective_visibility] struct PrivStruct; //~ ERROR Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) #[rustc_effective_visibility] - pub union PubUnion { //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + pub union PubUnion { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] a: u8, //~ ERROR Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) #[rustc_effective_visibility] - pub b: u8, //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + pub b: u8, //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub } #[rustc_effective_visibility] - pub enum Enum { //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + pub enum Enum { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] - A( //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + A( //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] - PubUnion, //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + PubUnion, //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub ), } } #[rustc_effective_visibility] - macro_rules! none_macro { //~ Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) + macro_rules! none_macro { //~ Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate) () => {}; } @@ -49,9 +49,9 @@ mod outer { //~ ERROR Public: pub(self), Exported: pub(self), Reachable: pub(sel } #[rustc_effective_visibility] - pub struct ReachableStruct { //~ ERROR Public: pub(self), Exported: pub(self), Reachable: pub, ReachableFromImplTrait: pub + pub struct ReachableStruct { //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] - pub a: u8, //~ ERROR Public: pub(self), Exported: pub(self), Reachable: pub, ReachableFromImplTrait: pub + pub a: u8, //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub } } @@ -62,14 +62,13 @@ pub fn foo() -> outer::ReachableStruct { outer::ReachableStruct {a: 0} } mod half_public_import { #[rustc_effective_visibility] - pub type HalfPublicImport = u8; //~ ERROR Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub + pub type HalfPublicImport = u8; //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub #[rustc_effective_visibility] #[allow(non_upper_case_globals)] - pub(crate) const HalfPublicImport: u8 = 0; //~ ERROR Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) + pub(crate) const HalfPublicImport: u8 = 0; //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate) } #[rustc_effective_visibility] pub use half_public_import::HalfPublicImport; //~ ERROR Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub - //~^ ERROR Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) fn main() {} diff --git a/src/test/ui/privacy/access_levels.stderr b/src/test/ui/privacy/access_levels.stderr index 81514d1fbab..19199a3eb87 100644 --- a/src/test/ui/privacy/access_levels.stderr +++ b/src/test/ui/privacy/access_levels.stderr @@ -1,22 +1,22 @@ -error: Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) +error: Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate) --> $DIR/access_levels.rs:4:1 | LL | mod outer { | ^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:6:5 | LL | pub mod inner1 { | ^^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:9:9 | LL | extern "C" {} | ^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:12:9 | LL | pub trait PubTrait { @@ -28,7 +28,7 @@ error: Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFr LL | struct PrivStruct; | ^^^^^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:23:9 | LL | pub union PubUnion { @@ -40,31 +40,31 @@ error: Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFr LL | a: u8, | ^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:27:13 | LL | pub b: u8, | ^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:31:9 | LL | pub enum Enum { | ^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:33:13 | LL | A( | ^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:35:17 | LL | PubUnion, | ^^^^^^^^ -error: Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) +error: Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate) --> $DIR/access_levels.rs:41:5 | LL | macro_rules! none_macro { @@ -76,13 +76,13 @@ error: Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub LL | macro_rules! public_macro { | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub(self), Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:52:5 | LL | pub struct ReachableStruct { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub(self), Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:54:9 | LL | pub a: u8, @@ -94,13 +94,13 @@ error: Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub LL | pub use outer::inner1; | ^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:65:5 | LL | pub type HalfPublicImport = u8; | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) +error: Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate) --> $DIR/access_levels.rs:68:5 | LL | pub(crate) const HalfPublicImport: u8 = 0; @@ -112,23 +112,17 @@ error: Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub LL | pub use half_public_import::HalfPublicImport; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub(self), Reachable: pub(self), ReachableFromImplTrait: pub(self) - --> $DIR/access_levels.rs:72:9 - | -LL | pub use half_public_import::HalfPublicImport; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:14:13 | LL | const A: i32; | ^^^^^^^^^^^^ -error: Public: pub(self), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub +error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub --> $DIR/access_levels.rs:16:13 | LL | type B; | ^^^^^^ -error: aborting due to 22 previous errors +error: aborting due to 21 previous errors |
