summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/where-priv-type.stderr
blob: d6baf22b3fbc081d17ae878174ed0c6b315d23ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
warning: private type `PrivTy` in public interface (error E0446)
  --> $DIR/where-priv-type.rs:25:1
   |
LL | pub struct S
   | ^^^^^^^^^^^^
   |
   = 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: `#[warn(private_in_public)]` on by default

warning: type `PrivTy` is more private than the item `S`
  --> $DIR/where-priv-type.rs:25:1
   |
LL | pub struct S
   | ^^^^^^^^^^^^ struct `S` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
  --> $DIR/where-priv-type.rs:15:1
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^
note: the lint level is defined here
  --> $DIR/where-priv-type.rs:8:9
   |
LL | #![warn(private_bounds)]
   |         ^^^^^^^^^^^^^^

warning: private type `PrivTy` in public interface (error E0446)
  --> $DIR/where-priv-type.rs:34:1
   |
LL | pub enum E
   | ^^^^^^^^^^
   |
   = 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>

warning: type `PrivTy` is more private than the item `E`
  --> $DIR/where-priv-type.rs:34:1
   |
LL | pub enum E
   | ^^^^^^^^^^ enum `E` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
  --> $DIR/where-priv-type.rs:15:1
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^

warning: private type `PrivTy` in public interface (error E0446)
  --> $DIR/where-priv-type.rs:43:1
   |
LL | / pub fn f()
LL | |
LL | |
LL | |
LL | | where
LL | |     PrivTy:
   | |___________^
   |
   = 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>

warning: type `PrivTy` is more private than the item `f`
  --> $DIR/where-priv-type.rs:43:1
   |
LL | / pub fn f()
LL | |
LL | |
LL | |
LL | | where
LL | |     PrivTy:
   | |___________^ function `f` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
  --> $DIR/where-priv-type.rs:15:1
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^

error[E0446]: private type `PrivTy` in public interface
  --> $DIR/where-priv-type.rs:52:1
   |
LL | struct PrivTy;
   | ------------- `PrivTy` declared as private
...
LL | impl S
   | ^^^^^^ can't leak private type

warning: type `PrivTy` is more private than the item `S`
  --> $DIR/where-priv-type.rs:52:1
   |
LL | impl S
   | ^^^^^^ implementation `S` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
  --> $DIR/where-priv-type.rs:15:1
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^

warning: private type `PrivTy` in public interface (error E0446)
  --> $DIR/where-priv-type.rs:58:5
   |
LL | /     pub fn f()
LL | |
LL | |
LL | |
LL | |     where
LL | |         PrivTy:
   | |_______________^
   |
   = 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>

warning: type `PrivTy` is more private than the item `S::f`
  --> $DIR/where-priv-type.rs:58:5
   |
LL | /     pub fn f()
LL | |
LL | |
LL | |
LL | |     where
LL | |         PrivTy:
   | |_______________^ associated function `S::f` is reachable at visibility `pub`
   |
note: but type `PrivTy` is only usable at visibility `pub(crate)`
  --> $DIR/where-priv-type.rs:15:1
   |
LL | struct PrivTy;
   | ^^^^^^^^^^^^^

error[E0446]: private type `fn(u8) -> u8 {my_const_fn}` in public interface
  --> $DIR/where-priv-type.rs:91:5
   |
LL |     type AssocTy = Const<{ my_const_fn(U) }>;
   |     ^^^^^^^^^^^^ can't leak private type
...
LL | const fn my_const_fn(val: u8) -> u8 {
   | ----------------------------------- `fn(u8) -> u8 {my_const_fn}` declared as private

warning: type `fn(u8) -> u8 {my_const_fn}` is more private than the item `<Const<U> as Trait>::AssocTy`
  --> $DIR/where-priv-type.rs:91:5
   |
LL |     type AssocTy = Const<{ my_const_fn(U) }>;
   |     ^^^^^^^^^^^^ associated type `<Const<U> as Trait>::AssocTy` is reachable at visibility `pub`
   |
note: but type `fn(u8) -> u8 {my_const_fn}` is only usable at visibility `pub(crate)`
  --> $DIR/where-priv-type.rs:99:1
   |
LL | const fn my_const_fn(val: u8) -> u8 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
  --> $DIR/where-priv-type.rs:9:9
   |
LL | #![warn(private_interfaces)]
   |         ^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors; 10 warnings emitted

For more information about this error, try `rustc --explain E0446`.