about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-09-22 16:19:53 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-10-26 16:34:53 +0400
commit34eb73c72d7e40d61ca2efa0dd1fedc89e21f0b8 (patch)
tree4eefd18268df6c8c57a4b18682c168f7e900045e /src/test
parent629a414d7ba4caa3ca28b0a46c478e2ecb4c0059 (diff)
downloadrust-34eb73c72d7e40d61ca2efa0dd1fedc89e21f0b8.tar.gz
rust-34eb73c72d7e40d61ca2efa0dd1fedc89e21f0b8.zip
privacy: Rename "accessibility levels" to "effective visibilities"
And a couple of other naming tweaks

Related to https://github.com/rust-lang/rust/issues/48054
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/privacy/access_levels.rs75
-rw-r--r--src/test/ui/privacy/access_levels.stderr134
-rw-r--r--src/test/ui/privacy/effective_visibilities.rs75
-rw-r--r--src/test/ui/privacy/effective_visibilities.stderr134
4 files changed, 209 insertions, 209 deletions
diff --git a/src/test/ui/privacy/access_levels.rs b/src/test/ui/privacy/access_levels.rs
deleted file mode 100644
index 6bca7161886..00000000000
--- a/src/test/ui/privacy/access_levels.rs
+++ /dev/null
@@ -1,75 +0,0 @@
-#![feature(rustc_attrs)]
-
-#[rustc_effective_visibility]
-mod outer { //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate)
-    #[rustc_effective_visibility]
-    pub mod inner1 { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-
-        #[rustc_effective_visibility]
-        extern "C" {} //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-
-        #[rustc_effective_visibility]
-        pub trait PubTrait { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-            #[rustc_effective_visibility]
-            const A: i32; //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-            #[rustc_effective_visibility]
-            type B; //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-        }
-
-        #[rustc_effective_visibility]
-        struct PrivStruct; //~ ERROR not in the table
-
-        #[rustc_effective_visibility]
-        pub union PubUnion { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-            #[rustc_effective_visibility]
-            a: u8, //~ ERROR not in the table
-            #[rustc_effective_visibility]
-            pub b: u8, //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-        }
-
-        #[rustc_effective_visibility]
-        pub enum Enum { //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-            #[rustc_effective_visibility]
-            A( //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-                #[rustc_effective_visibility]
-                PubUnion,  //~ ERROR Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-            ),
-        }
-    }
-
-    #[rustc_effective_visibility]
-    macro_rules! none_macro { //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate)
-        () => {};
-    }
-
-    #[macro_export]
-    #[rustc_effective_visibility]
-    macro_rules! public_macro { //~ ERROR Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-        () => {};
-    }
-
-    #[rustc_effective_visibility]
-    pub struct ReachableStruct { //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub
-        #[rustc_effective_visibility]
-        pub a: u8, //~ ERROR Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub
-    }
-}
-
-#[rustc_effective_visibility]
-pub use outer::inner1; //~ ERROR Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-
-pub fn foo() -> outer::ReachableStruct { outer::ReachableStruct {a: 0} }
-
-mod half_public_import {
-    #[rustc_effective_visibility]
-    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(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, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-
-fn main() {}
diff --git a/src/test/ui/privacy/access_levels.stderr b/src/test/ui/privacy/access_levels.stderr
deleted file mode 100644
index 07c4d436ff0..00000000000
--- a/src/test/ui/privacy/access_levels.stderr
+++ /dev/null
@@ -1,134 +0,0 @@
-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(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:6:5
-   |
-LL |     pub mod inner1 {
-   |     ^^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:9:9
-   |
-LL |         extern "C" {}
-   |         ^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:12:9
-   |
-LL |         pub trait PubTrait {
-   |         ^^^^^^^^^^^^^^^^^^
-
-error: not in the table
-  --> $DIR/access_levels.rs:20:9
-   |
-LL |         struct PrivStruct;
-   |         ^^^^^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:23:9
-   |
-LL |         pub union PubUnion {
-   |         ^^^^^^^^^^^^^^^^^^
-
-error: not in the table
-  --> $DIR/access_levels.rs:25:13
-   |
-LL |             a: u8,
-   |             ^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:27:13
-   |
-LL |             pub b: u8,
-   |             ^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:31:9
-   |
-LL |         pub enum Enum {
-   |         ^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:33:13
-   |
-LL |             A(
-   |             ^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:35:17
-   |
-LL |                 PubUnion,
-   |                 ^^^^^^^^
-
-error: Public: pub(crate), Exported: pub(crate), Reachable: pub(crate), ReachableFromImplTrait: pub(crate)
-  --> $DIR/access_levels.rs:41:5
-   |
-LL |     macro_rules! none_macro {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^
-
-error: Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:47:5
-   |
-LL |     macro_rules! public_macro {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:52:5
-   |
-LL |     pub struct ReachableStruct {
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub(crate), Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:54:9
-   |
-LL |         pub a: u8,
-   |         ^^^^^^^^^
-
-error: Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:59:9
-   |
-LL | pub use outer::inner1;
-   |         ^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:65:5
-   |
-LL |     pub type HalfPublicImport = u8;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-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;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:72:9
-   |
-LL | pub use half_public_import::HalfPublicImport;
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: Public: pub, Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:72:9
-   |
-LL | pub use half_public_import::HalfPublicImport;
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: Public: pub(crate), Exported: pub, Reachable: pub, ReachableFromImplTrait: pub
-  --> $DIR/access_levels.rs:14:13
-   |
-LL |             const A: i32;
-   |             ^^^^^^^^^^^^
-
-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
-
diff --git a/src/test/ui/privacy/effective_visibilities.rs b/src/test/ui/privacy/effective_visibilities.rs
new file mode 100644
index 00000000000..1d806a1d1d1
--- /dev/null
+++ b/src/test/ui/privacy/effective_visibilities.rs
@@ -0,0 +1,75 @@
+#![feature(rustc_attrs)]
+
+#[rustc_effective_visibility]
+mod outer { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+    #[rustc_effective_visibility]
+    pub mod inner1 { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+        #[rustc_effective_visibility]
+        extern "C" {} //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+        #[rustc_effective_visibility]
+        pub trait PubTrait { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+            #[rustc_effective_visibility]
+            const A: i32; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+            #[rustc_effective_visibility]
+            type B; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+        }
+
+        #[rustc_effective_visibility]
+        struct PrivStruct; //~ ERROR not in the table
+
+        #[rustc_effective_visibility]
+        pub union PubUnion { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+            #[rustc_effective_visibility]
+            a: u8, //~ ERROR not in the table
+            #[rustc_effective_visibility]
+            pub b: u8, //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+        }
+
+        #[rustc_effective_visibility]
+        pub enum Enum { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+            #[rustc_effective_visibility]
+            A( //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+                #[rustc_effective_visibility]
+                PubUnion,  //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+            ),
+        }
+    }
+
+    #[rustc_effective_visibility]
+    macro_rules! none_macro { //~ Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+        () => {};
+    }
+
+    #[macro_export]
+    #[rustc_effective_visibility]
+    macro_rules! public_macro { //~ Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+        () => {};
+    }
+
+    #[rustc_effective_visibility]
+    pub struct ReachableStruct { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+        #[rustc_effective_visibility]
+        pub a: u8, //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+    }
+}
+
+#[rustc_effective_visibility]
+pub use outer::inner1; //~ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+pub fn foo() -> outer::ReachableStruct { outer::ReachableStruct {a: 0} }
+
+mod half_public_import {
+    #[rustc_effective_visibility]
+    pub type HalfPublicImport = u8; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+    #[rustc_effective_visibility]
+    #[allow(non_upper_case_globals)]
+    pub(crate) const HalfPublicImport: u8 = 0; //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+}
+
+#[rustc_effective_visibility]
+pub use half_public_import::HalfPublicImport; //~ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+                                              //~^ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+fn main() {}
diff --git a/src/test/ui/privacy/effective_visibilities.stderr b/src/test/ui/privacy/effective_visibilities.stderr
new file mode 100644
index 00000000000..1c6201600b6
--- /dev/null
+++ b/src/test/ui/privacy/effective_visibilities.stderr
@@ -0,0 +1,134 @@
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+  --> $DIR/effective_visibilities.rs:4:1
+   |
+LL | mod outer {
+   | ^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:6:5
+   |
+LL |     pub mod inner1 {
+   |     ^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:9:9
+   |
+LL |         extern "C" {}
+   |         ^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:12:9
+   |
+LL |         pub trait PubTrait {
+   |         ^^^^^^^^^^^^^^^^^^
+
+error: not in the table
+  --> $DIR/effective_visibilities.rs:20:9
+   |
+LL |         struct PrivStruct;
+   |         ^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:23:9
+   |
+LL |         pub union PubUnion {
+   |         ^^^^^^^^^^^^^^^^^^
+
+error: not in the table
+  --> $DIR/effective_visibilities.rs:25:13
+   |
+LL |             a: u8,
+   |             ^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:27:13
+   |
+LL |             pub b: u8,
+   |             ^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:31:9
+   |
+LL |         pub enum Enum {
+   |         ^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:33:13
+   |
+LL |             A(
+   |             ^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:35:17
+   |
+LL |                 PubUnion,
+   |                 ^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+  --> $DIR/effective_visibilities.rs:41:5
+   |
+LL |     macro_rules! none_macro {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:47:5
+   |
+LL |     macro_rules! public_macro {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:52:5
+   |
+LL |     pub struct ReachableStruct {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:54:9
+   |
+LL |         pub a: u8,
+   |         ^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:59:9
+   |
+LL | pub use outer::inner1;
+   |         ^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:65:5
+   |
+LL |     pub type HalfPublicImport = u8;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+  --> $DIR/effective_visibilities.rs:68:5
+   |
+LL |     pub(crate) const HalfPublicImport: u8 = 0;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:72:9
+   |
+LL | pub use half_public_import::HalfPublicImport;
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:72:9
+   |
+LL | pub use half_public_import::HalfPublicImport;
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:14:13
+   |
+LL |             const A: i32;
+   |             ^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+  --> $DIR/effective_visibilities.rs:16:13
+   |
+LL |             type B;
+   |             ^^^^^^
+
+error: aborting due to 22 previous errors
+