about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2025-07-26 00:47:33 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2025-07-26 21:21:04 +0000
commita1f5a6d781d65949fe08c149a695d4cd926cc755 (patch)
tree82dc8b6e3298e360d570bbafc367c243cfbc7533 /tests
parenta2320b25533df01d9b96707187b64e03595c9bee (diff)
downloadrust-a1f5a6d781d65949fe08c149a695d4cd926cc755.tar.gz
rust-a1f5a6d781d65949fe08c149a695d4cd926cc755.zip
Perform check_private_in_public by module.
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/privacy/private-in-public-warn.stderr72
-rw-r--r--tests/ui/privacy/projections.stderr26
2 files changed, 49 insertions, 49 deletions
diff --git a/tests/ui/privacy/private-in-public-warn.stderr b/tests/ui/privacy/private-in-public-warn.stderr
index 86f6be85a07..edcffaf6b70 100644
--- a/tests/ui/privacy/private-in-public-warn.stderr
+++ b/tests/ui/privacy/private-in-public-warn.stderr
@@ -93,6 +93,42 @@ LL |     struct Priv;
 LL |         type Alias = Priv;
    |         ^^^^^^^^^^ can't leak private type
 
+error: type `types::Priv` is more private than the item `types::ES`
+  --> $DIR/private-in-public-warn.rs:27:9
+   |
+LL |         pub static ES: Priv;
+   |         ^^^^^^^^^^^^^^^^^^^ static `types::ES` is reachable at visibility `pub(crate)`
+   |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+  --> $DIR/private-in-public-warn.rs:9:5
+   |
+LL |     struct Priv;
+   |     ^^^^^^^^^^^
+
+error: type `types::Priv` is more private than the item `types::ef1`
+  --> $DIR/private-in-public-warn.rs:28:9
+   |
+LL |         pub fn ef1(arg: Priv);
+   |         ^^^^^^^^^^^^^^^^^^^^^^ function `types::ef1` is reachable at visibility `pub(crate)`
+   |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+  --> $DIR/private-in-public-warn.rs:9:5
+   |
+LL |     struct Priv;
+   |     ^^^^^^^^^^^
+
+error: type `types::Priv` is more private than the item `types::ef2`
+  --> $DIR/private-in-public-warn.rs:29:9
+   |
+LL |         pub fn ef2() -> Priv;
+   |         ^^^^^^^^^^^^^^^^^^^^^ function `types::ef2` is reachable at visibility `pub(crate)`
+   |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+  --> $DIR/private-in-public-warn.rs:9:5
+   |
+LL |     struct Priv;
+   |     ^^^^^^^^^^^
+
 error: trait `traits::PrivTr` is more private than the item `traits::Alias`
   --> $DIR/private-in-public-warn.rs:42:5
    |
@@ -359,42 +395,6 @@ note: but type `Priv2` is only usable at visibility `pub(self)`
 LL |     struct Priv2;
    |     ^^^^^^^^^^^^
 
-error: type `types::Priv` is more private than the item `types::ES`
-  --> $DIR/private-in-public-warn.rs:27:9
-   |
-LL |         pub static ES: Priv;
-   |         ^^^^^^^^^^^^^^^^^^^ static `types::ES` is reachable at visibility `pub(crate)`
-   |
-note: but type `types::Priv` is only usable at visibility `pub(self)`
-  --> $DIR/private-in-public-warn.rs:9:5
-   |
-LL |     struct Priv;
-   |     ^^^^^^^^^^^
-
-error: type `types::Priv` is more private than the item `types::ef1`
-  --> $DIR/private-in-public-warn.rs:28:9
-   |
-LL |         pub fn ef1(arg: Priv);
-   |         ^^^^^^^^^^^^^^^^^^^^^^ function `types::ef1` is reachable at visibility `pub(crate)`
-   |
-note: but type `types::Priv` is only usable at visibility `pub(self)`
-  --> $DIR/private-in-public-warn.rs:9:5
-   |
-LL |     struct Priv;
-   |     ^^^^^^^^^^^
-
-error: type `types::Priv` is more private than the item `types::ef2`
-  --> $DIR/private-in-public-warn.rs:29:9
-   |
-LL |         pub fn ef2() -> Priv;
-   |         ^^^^^^^^^^^^^^^^^^^^^ function `types::ef2` is reachable at visibility `pub(crate)`
-   |
-note: but type `types::Priv` is only usable at visibility `pub(self)`
-  --> $DIR/private-in-public-warn.rs:9:5
-   |
-LL |     struct Priv;
-   |     ^^^^^^^^^^^
-
 warning: bounds on generic parameters in type aliases are not enforced
   --> $DIR/private-in-public-warn.rs:42:23
    |
diff --git a/tests/ui/privacy/projections.stderr b/tests/ui/privacy/projections.stderr
index 010d77998e3..addb6a075a2 100644
--- a/tests/ui/privacy/projections.stderr
+++ b/tests/ui/privacy/projections.stderr
@@ -1,16 +1,3 @@
-warning: type `Priv` is more private than the item `Leak`
-  --> $DIR/projections.rs:3:5
-   |
-LL |     pub type Leak = Priv;
-   |     ^^^^^^^^^^^^^ type alias `Leak` is reachable at visibility `pub(crate)`
-   |
-note: but type `Priv` is only usable at visibility `pub(self)`
-  --> $DIR/projections.rs:2:5
-   |
-LL |     struct Priv;
-   |     ^^^^^^^^^^^
-   = note: `#[warn(private_interfaces)]` on by default
-
 error[E0446]: private type `Priv` in public interface
   --> $DIR/projections.rs:24:5
    |
@@ -29,6 +16,19 @@ LL |     struct Priv;
 LL |     type A<T: Trait> = T::A<m::Leak>;
    |     ^^^^^^^^^^^^^^^^ can't leak private type
 
+warning: type `Priv` is more private than the item `Leak`
+  --> $DIR/projections.rs:3:5
+   |
+LL |     pub type Leak = Priv;
+   |     ^^^^^^^^^^^^^ type alias `Leak` is reachable at visibility `pub(crate)`
+   |
+note: but type `Priv` is only usable at visibility `pub(self)`
+  --> $DIR/projections.rs:2:5
+   |
+LL |     struct Priv;
+   |     ^^^^^^^^^^^
+   = note: `#[warn(private_interfaces)]` on by default
+
 error: type `Priv` is private
   --> $DIR/projections.rs:14:15
    |