@@ -7,42 +7,32 @@ LL | struct Priv;
77LL | type A = Priv;
88 | ^^^^^^ can't leak private type
99
10- warning: trait `PrivTr` is more private than the item `PubTr::Alias1`
10+ error[E0446]: private trait `PrivTr` in public interface
1111 --> $DIR/private-in-public-assoc-ty.rs:24:9
1212 |
13- LL | type Alias1: PrivTr;
14- | ^^^^^^^^^^^^^^^^^^^ associated type `PubTr::Alias1` is reachable at visibility `pub(crate)`
15- |
16- note: but trait `PrivTr` is only usable at visibility `pub(self)`
17- --> $DIR/private-in-public-assoc-ty.rs:9:5
18- |
1913LL | trait PrivTr {}
20- | ^^^^^^^^^^^^
21- = note: `#[warn(private_bounds)]` on by default
14+ | ------------ `PrivTr` declared as private
15+ ...
16+ LL | type Alias1: PrivTr;
17+ | ^^^^^^^^^^^^^^^^^^^ can't leak private trait
2218
23- warning: type `Priv` is more private than the item `PubTr::Alias2`
19+ error[E0446]: private type `Priv` in public interface
2420 --> $DIR/private-in-public-assoc-ty.rs:26:9
2521 |
26- LL | type Alias2: PubTrAux1<Priv> = u8;
27- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated type `PubTr::Alias2` is reachable at visibility `pub(crate)`
28- |
29- note: but type `Priv` is only usable at visibility `pub(self)`
30- --> $DIR/private-in-public-assoc-ty.rs:8:5
31- |
3222LL | struct Priv;
33- | ^^^^^^^^^^^
23+ | ----------- `Priv` declared as private
24+ ...
25+ LL | type Alias2: PubTrAux1<Priv> = u8;
26+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
3427
35- warning: type `Priv` is more private than the item `PubTr::Alias3`
28+ error[E0446]: private type `Priv` in public interface
3629 --> $DIR/private-in-public-assoc-ty.rs:28:9
3730 |
38- LL | type Alias3: PubTrAux2<A = Priv> = u8;
39- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated type `PubTr::Alias3` is reachable at visibility `pub(crate)`
40- |
41- note: but type `Priv` is only usable at visibility `pub(self)`
42- --> $DIR/private-in-public-assoc-ty.rs:8:5
43- |
4431LL | struct Priv;
45- | ^^^^^^^^^^^
32+ | ----------- `Priv` declared as private
33+ ...
34+ LL | type Alias3: PubTrAux2<A = Priv> = u8;
35+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type
4636
4737error[E0446]: private type `Priv` in public interface
4838 --> $DIR/private-in-public-assoc-ty.rs:31:9
@@ -71,6 +61,6 @@ LL | trait PrivTr {}
7161LL | type Exist = impl PrivTr;
7262 | ^^^^^^^^^^ can't leak private trait
7363
74- error: aborting due to 4 previous errors; 3 warnings emitted
64+ error: aborting due to 7 previous errors
7565
7666For more information about this error, try `rustc --explain E0446`.
0 commit comments