summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/private-in-public.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/ui/privacy/private-in-public.stderr
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/privacy/private-in-public.stderr')
-rw-r--r--tests/ui/privacy/private-in-public.stderr468
1 files changed, 276 insertions, 192 deletions
diff --git a/tests/ui/privacy/private-in-public.stderr b/tests/ui/privacy/private-in-public.stderr
index 887eebf53..d8f9fd007 100644
--- a/tests/ui/privacy/private-in-public.stderr
+++ b/tests/ui/privacy/private-in-public.stderr
@@ -1,292 +1,376 @@
-error[E0446]: private type `types::Priv` in public interface
- --> $DIR/private-in-public.rs:13:5
+warning: type `types::Priv` is more private than the item `C`
+ --> $DIR/private-in-public.rs:15:5
|
-LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
LL | pub const C: Priv = Priv;
- | ^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0446]: private type `types::Priv` in public interface
- --> $DIR/private-in-public.rs:14:5
+ | ^^^^^^^^^^^^^^^^^ constant `C` is reachable at visibility `pub(crate)`
|
-LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub static S: Priv = Priv;
- | ^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0446]: private type `types::Priv` in public interface
- --> $DIR/private-in-public.rs:15:5
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
|
LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub fn f1(arg: Priv) {}
- | ^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
+ = note: `#[warn(private_interfaces)]` on by default
-error[E0446]: private type `types::Priv` in public interface
+warning: type `types::Priv` is more private than the item `S`
--> $DIR/private-in-public.rs:16:5
|
+LL | pub static S: Priv = Priv;
+ | ^^^^^^^^^^^^^^^^^^ static `S` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
+ |
LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub fn f2() -> Priv { panic!() }
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0446]: private type `types::Priv` in public interface
- --> $DIR/private-in-public.rs:17:19
+warning: type `types::Priv` is more private than the item `types::f1`
+ --> $DIR/private-in-public.rs:17:5
+ |
+LL | pub fn f1(arg: Priv) {}
+ | ^^^^^^^^^^^^^^^^^^^^ function `types::f1` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
|
LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub struct S1(pub Priv);
- | ^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0446]: private type `types::Priv` in public interface
- --> $DIR/private-in-public.rs:18:21
+warning: type `types::Priv` is more private than the item `types::f2`
+ --> $DIR/private-in-public.rs:18:5
+ |
+LL | pub fn f2() -> Priv { panic!() }
+ | ^^^^^^^^^^^^^^^^^^^ function `types::f2` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
|
LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub struct S2 { pub field: Priv }
- | ^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0446]: private type `types::Priv` in public interface
- --> $DIR/private-in-public.rs:20:9
+warning: type `types::Priv` is more private than the item `types::S1::0`
+ --> $DIR/private-in-public.rs:19:19
+ |
+LL | pub struct S1(pub Priv);
+ | ^^^^^^^^ field `types::S1::0` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
|
LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub const C: Priv = Priv;
- | ^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0446]: private type `types::Priv` in public interface
- --> $DIR/private-in-public.rs:21:9
+warning: type `types::Priv` is more private than the item `S2::field`
+ --> $DIR/private-in-public.rs:20:21
+ |
+LL | pub struct S2 { pub field: Priv }
+ | ^^^^^^^^^^^^^^^ field `S2::field` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
|
LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub fn f1(arg: Priv) {}
- | ^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0446]: private type `types::Priv` in public interface
+warning: type `types::Priv` is more private than the item `types::Pub::C`
--> $DIR/private-in-public.rs:22:9
|
+LL | pub const C: Priv = Priv;
+ | ^^^^^^^^^^^^^^^^^ associated constant `types::Pub::C` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
+ |
LL | struct Priv;
- | ----------- `types::Priv` declared as private
-...
-LL | pub fn f2() -> Priv { panic!() }
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0445]: private trait `traits::PrivTr` in public interface
- --> $DIR/private-in-public.rs:31:5
+warning: type `types::Priv` is more private than the item `types::Pub::f1`
+ --> $DIR/private-in-public.rs:23:9
|
-LL | trait PrivTr {}
- | ------------ `traits::PrivTr` declared as private
-...
-LL | pub enum E<T: PrivTr> { V(T) }
- | ^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+LL | pub fn f1(arg: Priv) {}
+ | ^^^^^^^^^^^^^^^^^^^^ associated function `types::Pub::f1` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
+ |
+LL | struct Priv;
+ | ^^^^^^^^^^^
-error[E0445]: private trait `traits::PrivTr` in public interface
- --> $DIR/private-in-public.rs:32:5
+warning: type `types::Priv` is more private than the item `types::Pub::f2`
+ --> $DIR/private-in-public.rs:24:9
|
-LL | trait PrivTr {}
- | ------------ `traits::PrivTr` declared as private
-...
-LL | pub fn f<T: PrivTr>(arg: T) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+LL | pub fn f2() -> Priv { panic!() }
+ | ^^^^^^^^^^^^^^^^^^^ associated function `types::Pub::f2` is reachable at visibility `pub(crate)`
+ |
+note: but type `types::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:9:5
+ |
+LL | struct Priv;
+ | ^^^^^^^^^^^
-error[E0445]: private trait `traits::PrivTr` in public interface
+warning: trait `traits::PrivTr` is more private than the item `traits::E`
--> $DIR/private-in-public.rs:33:5
|
+LL | pub enum E<T: PrivTr> { V(T) }
+ | ^^^^^^^^^^^^^^^^^^^^^ enum `traits::E` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:29:5
+ |
LL | trait PrivTr {}
- | ------------ `traits::PrivTr` declared as private
-...
-LL | pub struct S1<T: PrivTr>(T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^
+ = note: `#[warn(private_bounds)]` on by default
-error[E0445]: private trait `traits::PrivTr` in public interface
+warning: trait `traits::PrivTr` is more private than the item `traits::f`
--> $DIR/private-in-public.rs:34:5
|
+LL | pub fn f<T: PrivTr>(arg: T) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `traits::f` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:29:5
+ |
LL | trait PrivTr {}
- | ------------ `traits::PrivTr` declared as private
-...
-LL | impl<T: PrivTr> Pub<T> {
- | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^
-error[E0445]: private trait `traits::PrivTr` in public interface
- --> $DIR/private-in-public.rs:35:9
+warning: trait `traits::PrivTr` is more private than the item `traits::S1`
+ --> $DIR/private-in-public.rs:35:5
+ |
+LL | pub struct S1<T: PrivTr>(T);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ struct `traits::S1` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:29:5
|
LL | trait PrivTr {}
- | ------------ `traits::PrivTr` declared as private
-...
-LL | pub fn f<U: PrivTr>(arg: U) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^
-error[E0445]: private trait `traits_where::PrivTr` in public interface
- --> $DIR/private-in-public.rs:44:5
+warning: trait `traits::PrivTr` is more private than the item `traits::Pub<T>`
+ --> $DIR/private-in-public.rs:36:5
+ |
+LL | impl<T: PrivTr> Pub<T> {
+ | ^^^^^^^^^^^^^^^^^^^^^^ implementation `traits::Pub<T>` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:29:5
|
LL | trait PrivTr {}
- | ------------ `traits_where::PrivTr` declared as private
-...
-LL | pub enum E<T> where T: PrivTr { V(T) }
- | ^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^
-error[E0445]: private trait `traits_where::PrivTr` in public interface
+warning: trait `traits::PrivTr` is more private than the item `traits::Pub::<T>::f`
+ --> $DIR/private-in-public.rs:37:9
+ |
+LL | pub fn f<U: PrivTr>(arg: U) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits::Pub::<T>::f` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:29:5
+ |
+LL | trait PrivTr {}
+ | ^^^^^^^^^^^^
+
+warning: trait `traits_where::PrivTr` is more private than the item `traits_where::E`
--> $DIR/private-in-public.rs:46:5
|
+LL | pub enum E<T> where T: PrivTr { V(T) }
+ | ^^^^^^^^^^^^^ enum `traits_where::E` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:42:5
+ |
LL | trait PrivTr {}
- | ------------ `traits_where::PrivTr` declared as private
-...
-LL | pub fn f<T>(arg: T) where T: PrivTr {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^
-error[E0445]: private trait `traits_where::PrivTr` in public interface
+warning: trait `traits_where::PrivTr` is more private than the item `traits_where::f`
--> $DIR/private-in-public.rs:48:5
|
+LL | pub fn f<T>(arg: T) where T: PrivTr {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `traits_where::f` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:42:5
+ |
LL | trait PrivTr {}
- | ------------ `traits_where::PrivTr` declared as private
-...
-LL | pub struct S1<T>(T) where T: PrivTr;
- | ^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^
-error[E0445]: private trait `traits_where::PrivTr` in public interface
+warning: trait `traits_where::PrivTr` is more private than the item `traits_where::S1`
--> $DIR/private-in-public.rs:50:5
|
+LL | pub struct S1<T>(T) where T: PrivTr;
+ | ^^^^^^^^^^^^^^^^ struct `traits_where::S1` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:42:5
+ |
LL | trait PrivTr {}
- | ------------ `traits_where::PrivTr` declared as private
-...
-LL | impl<T> Pub<T> where T: PrivTr {
- | ^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^
-error[E0445]: private trait `traits_where::PrivTr` in public interface
- --> $DIR/private-in-public.rs:52:9
+warning: trait `traits_where::PrivTr` is more private than the item `traits_where::Pub<T>`
+ --> $DIR/private-in-public.rs:52:5
+ |
+LL | impl<T> Pub<T> where T: PrivTr {
+ | ^^^^^^^^^^^^^^ implementation `traits_where::Pub<T>` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:42:5
|
LL | trait PrivTr {}
- | ------------ `traits_where::PrivTr` declared as private
-...
+ | ^^^^^^^^^^^^
+
+warning: trait `traits_where::PrivTr` is more private than the item `traits_where::Pub::<T>::f`
+ --> $DIR/private-in-public.rs:54:9
+ |
LL | pub fn f<U>(arg: U) where U: PrivTr {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits_where::Pub::<T>::f` is reachable at visibility `pub(crate)`
+ |
+note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:42:5
+ |
+LL | trait PrivTr {}
+ | ^^^^^^^^^^^^
-error[E0446]: private type `generics::Priv` in public interface
- --> $DIR/private-in-public.rs:63:5
+warning: type `generics::Priv` is more private than the item `generics::f1`
+ --> $DIR/private-in-public.rs:65:5
|
-LL | struct Priv<T = u8>(T);
- | ------------------- `generics::Priv` declared as private
-...
LL | pub fn f1(arg: [Priv; 1]) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0446]: private type `generics::Priv` in public interface
- --> $DIR/private-in-public.rs:64:5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ function `generics::f1` is reachable at visibility `pub(crate)`
+ |
+note: but type `generics::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:60:5
|
LL | struct Priv<T = u8>(T);
- | ------------------- `generics::Priv` declared as private
-...
-LL | pub fn f2(arg: Pub<Priv>) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^
-error[E0446]: private type `generics::Priv<generics::Pub>` in public interface
- --> $DIR/private-in-public.rs:65:5
+warning: type `generics::Priv` is more private than the item `generics::f2`
+ --> $DIR/private-in-public.rs:66:5
+ |
+LL | pub fn f2(arg: Pub<Priv>) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ function `generics::f2` is reachable at visibility `pub(crate)`
+ |
+note: but type `generics::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:60:5
|
LL | struct Priv<T = u8>(T);
- | ------------------- `generics::Priv<generics::Pub>` declared as private
-...
+ | ^^^^^^^^^^^^^^^^^^^
+
+warning: type `generics::Priv<generics::Pub>` is more private than the item `generics::f3`
+ --> $DIR/private-in-public.rs:67:5
+ |
LL | pub fn f3(arg: Priv<Pub>) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ function `generics::f3` is reachable at visibility `pub(crate)`
+ |
+note: but type `generics::Priv<generics::Pub>` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:60:5
+ |
+LL | struct Priv<T = u8>(T);
+ | ^^^^^^^^^^^^^^^^^^^
-error[E0446]: private type `impls::Priv` in public interface
- --> $DIR/private-in-public.rs:80:9
+warning: type `impls::Priv` is more private than the item `impls::Pub::f`
+ --> $DIR/private-in-public.rs:82:9
|
-LL | struct Priv;
- | ----------- `impls::Priv` declared as private
-...
LL | pub fn f(arg: Priv) {}
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^ associated function `impls::Pub::f` is reachable at visibility `pub(crate)`
+ |
+note: but type `impls::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:72:5
+ |
+LL | struct Priv;
+ | ^^^^^^^^^^^
-error[E0445]: private trait `aliases_pub::PrivTr` in public interface
- --> $DIR/private-in-public.rs:104:5
+warning: trait `aliases_pub::PrivTr` is more private than the item `aliases_pub::f3`
+ --> $DIR/private-in-public.rs:106:5
|
-LL | trait PrivTr {
- | ------------ `aliases_pub::PrivTr` declared as private
-...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_pub::f3` is reachable at visibility `pub(crate)`
+ |
+note: but trait `aliases_pub::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:100:5
+ |
+LL | trait PrivTr {
+ | ^^^^^^^^^^^^
-error[E0446]: private type `aliases_pub::Priv` in public interface
- --> $DIR/private-in-public.rs:104:5
+warning: type `aliases_pub::Priv` is more private than the item `aliases_pub::f3`
+ --> $DIR/private-in-public.rs:106:5
|
-LL | struct Priv;
- | ----------- `aliases_pub::Priv` declared as private
-...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0446]: private type `aliases_pub::Priv` in public interface
- --> $DIR/private-in-public.rs:109:9
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_pub::f3` is reachable at visibility `pub(crate)`
+ |
+note: but type `aliases_pub::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:87:5
|
LL | struct Priv;
- | ----------- `aliases_pub::Priv` declared as private
-...
-LL | pub fn f(arg: Priv) {}
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0446]: private type `Priv1` in public interface
- --> $DIR/private-in-public.rs:131:5
+warning: type `Priv1` is more private than the item `aliases_priv::f1`
+ --> $DIR/private-in-public.rs:133:5
|
-LL | struct Priv1;
- | ------------ `Priv1` declared as private
-...
LL | pub fn f1(arg: PrivUseAlias) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_priv::f1` is reachable at visibility `pub(crate)`
+ |
+note: but type `Priv1` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:118:5
+ |
+LL | struct Priv1;
+ | ^^^^^^^^^^^^
-error[E0446]: private type `Priv2` in public interface
- --> $DIR/private-in-public.rs:132:5
+warning: type `Priv2` is more private than the item `aliases_priv::f2`
+ --> $DIR/private-in-public.rs:134:5
|
-LL | struct Priv2;
- | ------------ `Priv2` declared as private
-...
LL | pub fn f2(arg: PrivAlias) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_priv::f2` is reachable at visibility `pub(crate)`
+ |
+note: but type `Priv2` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:119:5
+ |
+LL | struct Priv2;
+ | ^^^^^^^^^^^^
-error[E0445]: private trait `aliases_priv::PrivTr` in public interface
- --> $DIR/private-in-public.rs:133:5
+warning: trait `aliases_priv::PrivTr` is more private than the item `aliases_priv::f3`
+ --> $DIR/private-in-public.rs:135:5
|
-LL | trait PrivTr {
- | ------------ `aliases_priv::PrivTr` declared as private
-...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_priv::f3` is reachable at visibility `pub(crate)`
+ |
+note: but trait `aliases_priv::PrivTr` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:128:5
+ |
+LL | trait PrivTr {
+ | ^^^^^^^^^^^^
-error[E0446]: private type `aliases_priv::Priv` in public interface
- --> $DIR/private-in-public.rs:133:5
+warning: type `aliases_priv::Priv` is more private than the item `aliases_priv::f3`
+ --> $DIR/private-in-public.rs:135:5
|
-LL | struct Priv;
- | ----------- `aliases_priv::Priv` declared as private
-...
LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0446]: private type `aliases_params::Priv` in public interface
- --> $DIR/private-in-public.rs:143:5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_priv::f3` is reachable at visibility `pub(crate)`
+ |
+note: but type `aliases_priv::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:116:5
|
LL | struct Priv;
- | ----------- `aliases_params::Priv` declared as private
-...
-LL | pub fn f2(arg: PrivAliasGeneric) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^
-error[E0446]: private type `aliases_params::Priv` in public interface
+warning: type `aliases_params::Priv` is more private than the item `aliases_params::f2`
--> $DIR/private-in-public.rs:145:5
|
+LL | pub fn f2(arg: PrivAliasGeneric) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_params::f2` is reachable at visibility `pub(crate)`
+ |
+note: but type `aliases_params::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:141:5
+ |
LL | struct Priv;
- | ----------- `aliases_params::Priv` declared as private
-...
+ | ^^^^^^^^^^^
+
+warning: type `aliases_params::Priv` is more private than the item `aliases_params::f3`
+ --> $DIR/private-in-public.rs:147:5
+ |
LL | pub fn f3(arg: Result<u8>) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ function `aliases_params::f3` is reachable at visibility `pub(crate)`
+ |
+note: but type `aliases_params::Priv` is only usable at visibility `pub(self)`
+ --> $DIR/private-in-public.rs:141:5
+ |
+LL | struct Priv;
+ | ^^^^^^^^^^^
-error: aborting due to 32 previous errors
+warning: 31 warnings emitted
-Some errors have detailed explanations: E0445, E0446.
-For more information about an error, try `rustc --explain E0445`.