diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
commit | e02c5b5930c2c9ba3e5423fe12e2ef0155017297 (patch) | |
tree | fd60ebbbb5299e16e5fca8c773ddb74f764760db /tests/ui/privacy/private-in-public-warn.stderr | |
parent | Adding debian version 1.73.0+dfsg1-1. (diff) | |
download | rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.tar.xz rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.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-warn.stderr')
-rw-r--r-- | tests/ui/privacy/private-in-public-warn.stderr | 376 |
1 files changed, 231 insertions, 145 deletions
diff --git a/tests/ui/privacy/private-in-public-warn.stderr b/tests/ui/privacy/private-in-public-warn.stderr index 66f91ce6f..6497b7ff5 100644 --- a/tests/ui/privacy/private-in-public-warn.stderr +++ b/tests/ui/privacy/private-in-public-warn.stderr @@ -1,46 +1,58 @@ -error: private type `types::Priv` in public interface (error E0446) +error: type `types::Priv` is more private than the item `types::Alias` --> $DIR/private-in-public-warn.rs:15:5 | LL | pub type Alias = Priv; - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ type alias `types::Alias` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but type `types::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:9:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ note: the lint level is defined here --> $DIR/private-in-public-warn.rs:5:9 | -LL | #![deny(private_in_public)] - | ^^^^^^^^^^^^^^^^^ +LL | #![deny(private_interfaces, private_bounds)] + | ^^^^^^^^^^^^^^^^^^ -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:18:12 +error: type `types::Priv` is more private than the item `E::V1::0` + --> $DIR/private-in-public-warn.rs:17:12 | LL | V1(Priv), - | ^^^^ + | ^^^^ field `E::V1::0` 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 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv; + | ^^^^^^^^^^^ -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:20:14 +error: type `types::Priv` is more private than the item `E::V2::field` + --> $DIR/private-in-public-warn.rs:18:14 | LL | V2 { field: Priv }, - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ field `E::V2::field` 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 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv; + | ^^^^^^^^^^^ -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:24:9 +error: type `types::Priv` is more private than the item `Tr::C` + --> $DIR/private-in-public-warn.rs:21:9 | LL | const C: Priv = Priv; - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ associated constant `Tr::C` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but type `types::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:9:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ error[E0446]: private type `types::Priv` in public interface - --> $DIR/private-in-public-warn.rs:26:9 + --> $DIR/private-in-public-warn.rs:22:9 | LL | struct Priv; | ----------- `types::Priv` declared as private @@ -48,53 +60,68 @@ LL | struct Priv; LL | type Alias = Priv; | ^^^^^^^^^^ can't leak private type -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:27:9 +error: type `types::Priv` is more private than the item `Tr::f1` + --> $DIR/private-in-public-warn.rs:23:9 | LL | fn f1(arg: Priv) {} - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ associated function `Tr::f1` 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 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv; + | ^^^^^^^^^^^ -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:29:9 +error: type `types::Priv` is more private than the item `Tr::f2` + --> $DIR/private-in-public-warn.rs:24:9 | LL | fn f2() -> Priv { panic!() } - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ associated function `Tr::f2` 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 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv; + | ^^^^^^^^^^^ -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:33:9 +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)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but type `types::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:9:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:35:9 +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)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but type `types::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:9:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ -error: private type `types::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:37:9 +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 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv; + | ^^^^^^^^^^^ error[E0446]: private type `types::Priv` in public interface - --> $DIR/private-in-public-warn.rs:41:9 + --> $DIR/private-in-public-warn.rs:32:9 | LL | struct Priv; | ----------- `types::Priv` declared as private @@ -102,134 +129,181 @@ LL | struct Priv; LL | type Alias = Priv; | ^^^^^^^^^^ can't leak private type -error: private trait `traits::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:50:5 +error: trait `traits::PrivTr` is more private than the item `traits::Alias` + --> $DIR/private-in-public-warn.rs:41:5 | LL | pub type Alias<T: PrivTr> = T; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ type alias `traits::Alias` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but trait `traits::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:37:5 + | +LL | trait PrivTr {} + | ^^^^^^^^^^^^ +note: the lint level is defined here + --> $DIR/private-in-public-warn.rs:5:29 + | +LL | #![deny(private_interfaces, private_bounds)] + | ^^^^^^^^^^^^^^ -error: private trait `traits::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:53:5 +error: trait `traits::PrivTr` is more private than the item `traits::Tr1` + --> $DIR/private-in-public-warn.rs:43:5 | LL | pub trait Tr1: PrivTr {} - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ trait `traits::Tr1` is reachable at visibility `pub(crate)` + | +note: but trait `traits::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:37:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:55:5 +error: trait `traits::PrivTr` is more private than the item `traits::Tr2` + --> $DIR/private-in-public-warn.rs:44:5 | LL | pub trait Tr2<T: PrivTr> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ trait `traits::Tr2` is reachable at visibility `pub(crate)` + | +note: but trait `traits::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:37:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:58:9 +error: trait `traits::PrivTr` is more private than the item `traits::Tr3::Alias` + --> $DIR/private-in-public-warn.rs:46:9 | LL | type Alias: PrivTr; - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ associated type `traits::Tr3::Alias` is reachable at visibility `pub(crate)` + | +note: but trait `traits::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:37:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:61:9 +error: trait `traits::PrivTr` is more private than the item `traits::Tr3::f` + --> $DIR/private-in-public-warn.rs:48:9 | LL | fn f<T: PrivTr>(arg: T) {} - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits::Tr3::f` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but trait `traits::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:37:5 + | +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:64:5 +error: trait `traits::PrivTr` is more private than the item `traits::Pub<T>` + --> $DIR/private-in-public-warn.rs:50:5 | LL | impl<T: PrivTr> Pub<T> {} - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ implementation `traits::Pub<T>` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but trait `traits::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:37:5 + | +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits_where::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:74:5 +error: trait `traits_where::PrivTr` is more private than the item `traits_where::Alias` + --> $DIR/private-in-public-warn.rs:59:5 | LL | pub type Alias<T> where T: PrivTr = T; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ type alias `traits_where::Alias` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:55:5 + | +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits_where::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:78:5 +error: trait `traits_where::PrivTr` is more private than the item `traits_where::Tr2` + --> $DIR/private-in-public-warn.rs:62:5 | LL | pub trait Tr2<T> where T: PrivTr {} - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ trait `traits_where::Tr2` is reachable at visibility `pub(crate)` + | +note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:55:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits_where::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:82:9 +error: trait `traits_where::PrivTr` is more private than the item `traits_where::Tr3::f` + --> $DIR/private-in-public-warn.rs:65:9 | LL | fn f<T>(arg: T) where T: PrivTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function `traits_where::Tr3::f` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but trait `traits_where::PrivTr` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:55:5 + | +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `traits_where::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:86:5 +error: trait `traits_where::PrivTr` is more private than the item `traits_where::Pub<T>` + --> $DIR/private-in-public-warn.rs:68: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-warn.rs:55:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | trait PrivTr {} + | ^^^^^^^^^^^^ -error: private trait `generics::PrivTr<generics::Pub>` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:98:5 +error: trait `generics::PrivTr<generics::Pub>` is more private than the item `generics::Tr1` + --> $DIR/private-in-public-warn.rs:79:5 | LL | pub trait Tr1: PrivTr<Pub> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr1` is reachable at visibility `pub(crate)` + | +note: but trait `generics::PrivTr<generics::Pub>` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:76:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | trait PrivTr<T> {} + | ^^^^^^^^^^^^^^^ -error: private type `generics::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:101:5 +error: type `generics::Priv` is more private than the item `generics::Tr2` + --> $DIR/private-in-public-warn.rs:81:5 | LL | pub trait Tr2: PubTr<Priv> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr2` is reachable at visibility `pub(crate)` + | +note: but type `generics::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:74:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv<T = u8>(T); + | ^^^^^^^^^^^^^^^^^^^ -error: private type `generics::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:103:5 +error: type `generics::Priv` is more private than the item `generics::Tr3` + --> $DIR/private-in-public-warn.rs:82:5 | LL | pub trait Tr3: PubTr<[Priv; 1]> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `generics::Tr3` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but type `generics::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:74:5 + | +LL | struct Priv<T = u8>(T); + | ^^^^^^^^^^^^^^^^^^^ -error: private type `generics::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:105:5 +error: type `generics::Priv` is more private than the item `Tr4` + --> $DIR/private-in-public-warn.rs:83:5 | LL | pub trait Tr4: PubTr<Pub<Priv>> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `Tr4` is reachable at visibility `pub(crate)` + | +note: but type `generics::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:74:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv<T = u8>(T); + | ^^^^^^^^^^^^^^^^^^^ error[E0446]: private type `impls::Priv` in public interface - --> $DIR/private-in-public-warn.rs:132:9 + --> $DIR/private-in-public-warn.rs:109:9 | LL | struct Priv; | ----------- `impls::Priv` declared as private @@ -237,17 +311,20 @@ LL | struct Priv; LL | type Alias = Priv; | ^^^^^^^^^^ can't leak private type -error: private type `aliases_pub::Priv` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:203:9 +error: type `aliases_pub::Priv` is more private than the item `aliases_pub::<impl Pub2>::f` + --> $DIR/private-in-public-warn.rs:180:9 | LL | pub fn f(arg: Priv) {} - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ associated function `aliases_pub::<impl Pub2>::f` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but type `aliases_pub::Priv` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:153:5 + | +LL | struct Priv; + | ^^^^^^^^^^^ error[E0446]: private type `aliases_pub::Priv` in public interface - --> $DIR/private-in-public-warn.rs:207:9 + --> $DIR/private-in-public-warn.rs:183:9 | LL | struct Priv; | ----------- `aliases_pub::Priv` declared as private @@ -256,7 +333,7 @@ LL | type Check = Priv; | ^^^^^^^^^^ can't leak private type error[E0446]: private type `aliases_pub::Priv` in public interface - --> $DIR/private-in-public-warn.rs:210:9 + --> $DIR/private-in-public-warn.rs:186:9 | LL | struct Priv; | ----------- `aliases_pub::Priv` declared as private @@ -265,7 +342,7 @@ LL | type Check = Priv; | ^^^^^^^^^^ can't leak private type error[E0446]: private type `aliases_pub::Priv` in public interface - --> $DIR/private-in-public-warn.rs:213:9 + --> $DIR/private-in-public-warn.rs:189:9 | LL | struct Priv; | ----------- `aliases_pub::Priv` declared as private @@ -274,7 +351,7 @@ LL | type Check = Priv; | ^^^^^^^^^^ can't leak private type error[E0446]: private type `aliases_pub::Priv` in public interface - --> $DIR/private-in-public-warn.rs:216:9 + --> $DIR/private-in-public-warn.rs:192:9 | LL | struct Priv; | ----------- `aliases_pub::Priv` declared as private @@ -282,35 +359,44 @@ LL | struct Priv; LL | type Check = Priv; | ^^^^^^^^^^ can't leak private type -error: private trait `PrivTr1` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:246:5 +error: trait `PrivTr1` is more private than the item `aliases_priv::Tr1` + --> $DIR/private-in-public-warn.rs:222:5 | LL | pub trait Tr1: PrivUseAliasTr {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr1` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but trait `PrivTr1` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:208:5 + | +LL | trait PrivTr1<T = u8> { + | ^^^^^^^^^^^^^^^^^^^^^ -error: private trait `PrivTr1<Priv2>` in public interface (error E0445) - --> $DIR/private-in-public-warn.rs:249:5 +error: trait `PrivTr1<Priv2>` is more private than the item `aliases_priv::Tr2` + --> $DIR/private-in-public-warn.rs:224:5 | LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)` | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +note: but trait `PrivTr1<Priv2>` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:208:5 + | +LL | trait PrivTr1<T = u8> { + | ^^^^^^^^^^^^^^^^^^^^^ -error: private type `Priv2` in public interface (error E0446) - --> $DIR/private-in-public-warn.rs:249:5 +error: type `Priv2` is more private than the item `aliases_priv::Tr2` + --> $DIR/private-in-public-warn.rs:224:5 | LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait `aliases_priv::Tr2` is reachable at visibility `pub(crate)` + | +note: but type `Priv2` is only usable at visibility `pub(self)` + --> $DIR/private-in-public-warn.rs:206:5 | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> +LL | struct Priv2; + | ^^^^^^^^^^^^ warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/private-in-public-warn.rs:50:23 + --> $DIR/private-in-public-warn.rs:41:23 | LL | pub type Alias<T: PrivTr> = T; | ^^^^^^ @@ -323,7 +409,7 @@ LL + pub type Alias<T> = T; | warning: where clauses are not enforced in type aliases - --> $DIR/private-in-public-warn.rs:74:29 + --> $DIR/private-in-public-warn.rs:59:29 | LL | pub type Alias<T> where T: PrivTr = T; | ^^^^^^^^^ |