fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.5 KiB76 linesraw
1error[E0446]: private type `Priv` in public interface
2  --> $DIR/private-in-public-assoc-ty.rs:17:9
3   |
4LL |     struct Priv;
5   |     ----------- `Priv` declared as private
6...
7LL |         type A = Priv;
8   |         ^^^^^^ can't leak private type
9
10warning: trait `PrivTr` is more private than the item `PubTr::Alias1`
11  --> $DIR/private-in-public-assoc-ty.rs:24:9
12   |
13LL |         type Alias1: PrivTr;
14   |         ^^^^^^^^^^^^^^^^^^^ associated type `PubTr::Alias1` is reachable at visibility `pub(crate)`
15   |
16note: but trait `PrivTr` is only usable at visibility `pub(self)`
17  --> $DIR/private-in-public-assoc-ty.rs:9:5
18   |
19LL |     trait PrivTr {}
20   |     ^^^^^^^^^^^^
21   = note: `#[warn(private_bounds)]` on by default
22
23warning: type `Priv` is more private than the item `PubTr::Alias2`
24  --> $DIR/private-in-public-assoc-ty.rs:26:9
25   |
26LL |         type Alias2: PubTrAux1<Priv> = u8;
27   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated type `PubTr::Alias2` is reachable at visibility `pub(crate)`
28   |
29note: but type `Priv` is only usable at visibility `pub(self)`
30  --> $DIR/private-in-public-assoc-ty.rs:8:5
31   |
32LL |     struct Priv;
33   |     ^^^^^^^^^^^
34
35warning: type `Priv` is more private than the item `PubTr::Alias3`
36  --> $DIR/private-in-public-assoc-ty.rs:28:9
37   |
38LL |         type Alias3: PubTrAux2<A = Priv> = u8;
39   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated type `PubTr::Alias3` is reachable at visibility `pub(crate)`
40   |
41note: but type `Priv` is only usable at visibility `pub(self)`
42  --> $DIR/private-in-public-assoc-ty.rs:8:5
43   |
44LL |     struct Priv;
45   |     ^^^^^^^^^^^
46
47error[E0446]: private type `Priv` in public interface
48  --> $DIR/private-in-public-assoc-ty.rs:31:9
49   |
50LL |     struct Priv;
51   |     ----------- `Priv` declared as private
52...
53LL |         type Alias4 = Priv;
54   |         ^^^^^^^^^^^ can't leak private type
55
56error[E0446]: private type `Priv` in public interface
57  --> $DIR/private-in-public-assoc-ty.rs:38:9
58   |
59LL |     struct Priv;
60   |     ----------- `Priv` declared as private
61...
62LL |         type Alias1 = Priv;
63   |         ^^^^^^^^^^^ can't leak private type
64
65error[E0446]: private trait `PrivTr` in public interface
66  --> $DIR/private-in-public-assoc-ty.rs:41:9
67   |
68LL |     trait PrivTr {}
69   |     ------------ `PrivTr` declared as private
70...
71LL |         type Exist = impl PrivTr;
72   |         ^^^^^^^^^^ can't leak private trait
73
74error: aborting due to 4 previous errors; 3 warnings emitted
75
76For more information about this error, try `rustc --explain E0446`.