fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
15.4 KiB361 linesraw
1error: private type `types::Priv` in public interface (error E0446)
2  --> $DIR/private-in-public-warn.rs:15:5
3   |
4LL |     pub type Alias = Priv;
5   |     ^^^^^^^^^^^^^^^^^^^^^^
6   |
7note: lint level defined here
8  --> $DIR/private-in-public-warn.rs:5:9
9   |
10LL | #![deny(private_in_public)]
11   |         ^^^^^^^^^^^^^^^^^
12   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
14
15error: private type `types::Priv` in public interface (error E0446)
16  --> $DIR/private-in-public-warn.rs:18:12
17   |
18LL |         V1(Priv),
19   |            ^^^^
20   |
21   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
22   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
23
24error: private type `types::Priv` in public interface (error E0446)
25  --> $DIR/private-in-public-warn.rs:20:14
26   |
27LL |         V2 { field: Priv },
28   |              ^^^^^^^^^^^
29   |
30   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
31   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
32
33error: private type `types::Priv` in public interface (error E0446)
34  --> $DIR/private-in-public-warn.rs:24:9
35   |
36LL |         const C: Priv = Priv;
37   |         ^^^^^^^^^^^^^^^^^^^^^
38   |
39   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
40   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
41
42error[E0446]: private type `types::Priv` in public interface
43  --> $DIR/private-in-public-warn.rs:26:9
44   |
45LL |     struct Priv;
46   |     - `types::Priv` declared as private
47...
48LL |         type Alias = Priv;
49   |         ^^^^^^^^^^^^^^^^^^ can't leak private type
50
51error: private type `types::Priv` in public interface (error E0446)
52  --> $DIR/private-in-public-warn.rs:27:9
53   |
54LL |         fn f1(arg: Priv) {}
55   |         ^^^^^^^^^^^^^^^^^^^
56   |
57   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
58   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
59
60error: private type `types::Priv` in public interface (error E0446)
61  --> $DIR/private-in-public-warn.rs:29:9
62   |
63LL |         fn f2() -> Priv { panic!() }
64   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65   |
66   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
67   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
68
69error: private type `types::Priv` in public interface (error E0446)
70  --> $DIR/private-in-public-warn.rs:33:9
71   |
72LL |         pub static ES: Priv;
73   |         ^^^^^^^^^^^^^^^^^^^^
74   |
75   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
76   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
77
78error: private type `types::Priv` in public interface (error E0446)
79  --> $DIR/private-in-public-warn.rs:35:9
80   |
81LL |         pub fn ef1(arg: Priv);
82   |         ^^^^^^^^^^^^^^^^^^^^^^
83   |
84   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
85   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
86
87error: private type `types::Priv` in public interface (error E0446)
88  --> $DIR/private-in-public-warn.rs:37:9
89   |
90LL |         pub fn ef2() -> Priv;
91   |         ^^^^^^^^^^^^^^^^^^^^^
92   |
93   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
94   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
95
96error[E0446]: private type `types::Priv` in public interface
97  --> $DIR/private-in-public-warn.rs:41:9
98   |
99LL |     struct Priv;
100   |     - `types::Priv` declared as private
101...
102LL |         type Alias = Priv;
103   |         ^^^^^^^^^^^^^^^^^^ can't leak private type
104
105error: private trait `traits::PrivTr` in public interface (error E0445)
106  --> $DIR/private-in-public-warn.rs:50:5
107   |
108LL |     pub type Alias<T: PrivTr> = T;
109   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110   |
111   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
112   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
113
114error: private trait `traits::PrivTr` in public interface (error E0445)
115  --> $DIR/private-in-public-warn.rs:53:5
116   |
117LL |     pub trait Tr1: PrivTr {}
118   |     ^^^^^^^^^^^^^^^^^^^^^^^^
119   |
120   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
121   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
122
123error: private trait `traits::PrivTr` in public interface (error E0445)
124  --> $DIR/private-in-public-warn.rs:55:5
125   |
126LL |     pub trait Tr2<T: PrivTr> {}
127   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
128   |
129   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
130   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
131
132error: private trait `traits::PrivTr` in public interface (error E0445)
133  --> $DIR/private-in-public-warn.rs:57:5
134   |
135LL | /     pub trait Tr3 {
136LL | |
137LL | |
138LL | |         type Alias: PrivTr;
139LL | |         fn f<T: PrivTr>(arg: T) {}
140LL | |
141LL | |     }
142   | |_____^
143   |
144   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
145   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
146
147error: private trait `traits::PrivTr` in public interface (error E0445)
148  --> $DIR/private-in-public-warn.rs:61:9
149   |
150LL |         fn f<T: PrivTr>(arg: T) {}
151   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
152   |
153   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
154   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
155
156error: private trait `traits::PrivTr` in public interface (error E0445)
157  --> $DIR/private-in-public-warn.rs:64:5
158   |
159LL |     impl<T: PrivTr> Pub<T> {}
160   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
161   |
162   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
163   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
164
165error: private trait `traits::PrivTr` in public interface (error E0445)
166  --> $DIR/private-in-public-warn.rs:66:5
167   |
168LL |     impl<T: PrivTr> PubTr for Pub<T> {}
169   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170   |
171   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
172   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
173
174error: private trait `traits_where::PrivTr` in public interface (error E0445)
175  --> $DIR/private-in-public-warn.rs:75:5
176   |
177LL |     pub type Alias<T> where T: PrivTr = T;
178   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179   |
180   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
181   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
182
183error: private trait `traits_where::PrivTr` in public interface (error E0445)
184  --> $DIR/private-in-public-warn.rs:79:5
185   |
186LL |     pub trait Tr2<T> where T: PrivTr {}
187   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188   |
189   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
190   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
191
192error: private trait `traits_where::PrivTr` in public interface (error E0445)
193  --> $DIR/private-in-public-warn.rs:83:9
194   |
195LL |         fn f<T>(arg: T) where T: PrivTr {}
196   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
197   |
198   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
199   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
200
201error: private trait `traits_where::PrivTr` in public interface (error E0445)
202  --> $DIR/private-in-public-warn.rs:87:5
203   |
204LL |     impl<T> Pub<T> where T: PrivTr {}
205   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
206   |
207   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
208   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
209
210error: private trait `traits_where::PrivTr` in public interface (error E0445)
211  --> $DIR/private-in-public-warn.rs:90:5
212   |
213LL |     impl<T> PubTr for Pub<T> where T: PrivTr {}
214   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
215   |
216   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
217   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
218
219error: private trait `generics::PrivTr<generics::Pub>` in public interface (error E0445)
220  --> $DIR/private-in-public-warn.rs:101:5
221   |
222LL |     pub trait Tr1: PrivTr<Pub> {}
223   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
224   |
225   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
226   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
227
228error: private type `generics::Priv` in public interface (error E0446)
229  --> $DIR/private-in-public-warn.rs:104:5
230   |
231LL |     pub trait Tr2: PubTr<Priv> {}
232   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
233   |
234   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
235   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
236
237error: private type `generics::Priv` in public interface (error E0446)
238  --> $DIR/private-in-public-warn.rs:106:5
239   |
240LL |     pub trait Tr3: PubTr<[Priv; 1]> {}
241   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
242   |
243   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
244   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
245
246error: private type `generics::Priv` in public interface (error E0446)
247  --> $DIR/private-in-public-warn.rs:108:5
248   |
249LL |     pub trait Tr4: PubTr<Pub<Priv>> {}
250   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
251   |
252   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
253   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
254
255error[E0446]: private type `impls::Priv` in public interface
256  --> $DIR/private-in-public-warn.rs:135:9
257   |
258LL |     struct Priv;
259   |     - `impls::Priv` declared as private
260...
261LL |         type Alias = Priv;
262   |         ^^^^^^^^^^^^^^^^^^ can't leak private type
263
264error: private type `aliases_pub::Priv` in public interface (error E0446)
265  --> $DIR/private-in-public-warn.rs:206:9
266   |
267LL |         pub fn f(arg: Priv) {}
268   |         ^^^^^^^^^^^^^^^^^^^^^^
269   |
270   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
271   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
272
273error[E0446]: private type `aliases_pub::Priv` in public interface
274  --> $DIR/private-in-public-warn.rs:210:9
275   |
276LL |     struct Priv;
277   |     - `aliases_pub::Priv` declared as private
278...
279LL |         type Check = Priv;
280   |         ^^^^^^^^^^^^^^^^^^ can't leak private type
281
282error[E0446]: private type `aliases_pub::Priv` in public interface
283  --> $DIR/private-in-public-warn.rs:213:9
284   |
285LL |     struct Priv;
286   |     - `aliases_pub::Priv` declared as private
287...
288LL |         type Check = Priv;
289   |         ^^^^^^^^^^^^^^^^^^ can't leak private type
290
291error[E0446]: private type `aliases_pub::Priv` in public interface
292  --> $DIR/private-in-public-warn.rs:216:9
293   |
294LL |     struct Priv;
295   |     - `aliases_pub::Priv` declared as private
296...
297LL |         type Check = Priv;
298   |         ^^^^^^^^^^^^^^^^^^ can't leak private type
299
300error[E0446]: private type `aliases_pub::Priv` in public interface
301  --> $DIR/private-in-public-warn.rs:219:9
302   |
303LL |     struct Priv;
304   |     - `aliases_pub::Priv` declared as private
305...
306LL |         type Check = Priv;
307   |         ^^^^^^^^^^^^^^^^^^ can't leak private type
308
309error: private trait `aliases_priv::PrivTr1` in public interface (error E0445)
310  --> $DIR/private-in-public-warn.rs:249:5
311   |
312LL |     pub trait Tr1: PrivUseAliasTr {}
313   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
314   |
315   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
316   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
317
318error: private trait `aliases_priv::PrivTr1<aliases_priv::Priv2>` in public interface (error E0445)
319  --> $DIR/private-in-public-warn.rs:252:5
320   |
321LL |     pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
322   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
323   |
324   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
325   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
326
327error: private type `aliases_priv::Priv2` in public interface (error E0446)
328  --> $DIR/private-in-public-warn.rs:252:5
329   |
330LL |     pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
331   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
332   |
333   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
334   = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
335
336warning: bounds on generic parameters are not enforced in type aliases
337  --> $DIR/private-in-public-warn.rs:50:23
338   |
339LL |     pub type Alias<T: PrivTr> = T;
340   |                       ^^^^^^
341   |
342   = note: `#[warn(type_alias_bounds)]` on by default
343help: the bound will not be checked when the type alias is used, and should be removed
344   |
345LL |     pub type Alias<T> = T;
346   |                    --
347
348warning: where clauses are not enforced in type aliases
349  --> $DIR/private-in-public-warn.rs:75:29
350   |
351LL |     pub type Alias<T> where T: PrivTr = T;
352   |                             ^^^^^^^^^
353   |
354help: the clause will not be checked when the type alias is used, and should be removed
355   |
356LL |     pub type Alias<T>  = T;
357   |                      --
358
359error: aborting due to 36 previous errors
360
361For more information about this error, try `rustc --explain E0446`.