1 error[E0666]: nested `impl Trait` is not allowed
2 --> $DIR/where-allowed.rs:47:51
4 LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
7 | | nested `impl Trait` here
10 error[E0666]: nested `impl Trait` is not allowed
11 --> $DIR/where-allowed.rs:56:57
13 LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
16 | | nested `impl Trait` here
19 error[E0658]: `impl Trait` in type aliases is unstable
20 --> $DIR/where-allowed.rs:119:16
22 LL | type Out = impl Debug;
25 = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
26 = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
28 error[E0658]: `impl Trait` in type aliases is unstable
29 --> $DIR/where-allowed.rs:154:23
31 LL | type InTypeAlias<R> = impl Debug;
34 = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
35 = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
37 error[E0658]: `impl Trait` in type aliases is unstable
38 --> $DIR/where-allowed.rs:157:39
40 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
43 = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
44 = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
46 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
47 --> $DIR/where-allowed.rs:15:40
49 LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
52 = note: found `impl Trait` in `fn` pointer param
54 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
55 --> $DIR/where-allowed.rs:19:42
57 LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
60 = note: found `impl Trait` in `fn` pointer return
62 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
63 --> $DIR/where-allowed.rs:23:38
65 LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
68 = note: found `impl Trait` in `fn` pointer param
70 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
71 --> $DIR/where-allowed.rs:27:40
73 LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
76 = note: found `impl Trait` in `fn` pointer return
78 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
79 --> $DIR/where-allowed.rs:31:49
81 LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
84 = note: found `impl Trait` in `Fn` trait param
86 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
87 --> $DIR/where-allowed.rs:35:51
89 LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
92 = note: found `impl Trait` in `Fn` trait return
94 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
95 --> $DIR/where-allowed.rs:39:55
97 LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
100 = note: found `impl Trait` in `Fn` trait param
102 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
103 --> $DIR/where-allowed.rs:43:57
105 LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
108 = note: found `impl Trait` in `Fn` trait return
110 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
111 --> $DIR/where-allowed.rs:47:51
113 LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
116 = note: found `impl Trait` in `Fn` trait param
118 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
119 --> $DIR/where-allowed.rs:52:53
121 LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
124 = note: found `impl Trait` in `Fn` trait return
126 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
127 --> $DIR/where-allowed.rs:56:57
129 LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
132 = note: found `impl Trait` in `Fn` trait param
134 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
135 --> $DIR/where-allowed.rs:61:59
137 LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
140 = note: found `impl Trait` in `Fn` trait return
142 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
143 --> $DIR/where-allowed.rs:65:38
145 LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
148 = note: found `impl Trait` in `Fn` trait param
150 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
151 --> $DIR/where-allowed.rs:69:40
153 LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
156 = note: found `impl Trait` in `Fn` trait return
158 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
159 --> $DIR/where-allowed.rs:82:32
161 LL | struct InBraceStructField { x: impl Debug }
164 = note: found `impl Trait` in type
166 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
167 --> $DIR/where-allowed.rs:86:41
169 LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
172 = note: found `impl Trait` in path
174 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
175 --> $DIR/where-allowed.rs:90:27
177 LL | struct InTupleStructField(impl Debug);
180 = note: found `impl Trait` in type
182 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
183 --> $DIR/where-allowed.rs:95:25
185 LL | InBraceVariant { x: impl Debug },
188 = note: found `impl Trait` in type
190 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
191 --> $DIR/where-allowed.rs:97:20
193 LL | InTupleVariant(impl Debug),
196 = note: found `impl Trait` in type
198 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
199 --> $DIR/where-allowed.rs:108:23
201 LL | fn in_return() -> impl Debug;
204 = note: found `impl Trait` in trait method return
206 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
207 --> $DIR/where-allowed.rs:125:34
209 LL | fn in_trait_impl_return() -> impl Debug { () }
212 = note: found `impl Trait` in `impl` method return
214 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
215 --> $DIR/where-allowed.rs:138:33
217 LL | fn in_foreign_parameters(_: impl Debug);
220 = note: found `impl Trait` in `extern fn` param
222 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
223 --> $DIR/where-allowed.rs:141:31
225 LL | fn in_foreign_return() -> impl Debug;
228 = note: found `impl Trait` in `extern fn` return
230 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
231 --> $DIR/where-allowed.rs:157:39
233 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
236 = note: found `impl Trait` in `fn` pointer return
238 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
239 --> $DIR/where-allowed.rs:162:16
241 LL | impl PartialEq<impl Debug> for () {
244 = note: found `impl Trait` in trait
246 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
247 --> $DIR/where-allowed.rs:167:24
249 LL | impl PartialEq<()> for impl Debug {
252 = note: found `impl Trait` in type
254 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
255 --> $DIR/where-allowed.rs:172:6
257 LL | impl impl Debug {
260 = note: found `impl Trait` in type
262 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
263 --> $DIR/where-allowed.rs:178:24
265 LL | impl InInherentImplAdt<impl Debug> {
268 = note: found `impl Trait` in type
270 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
271 --> $DIR/where-allowed.rs:184:11
273 LL | where impl Debug: Debug
276 = note: found `impl Trait` in type
278 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
279 --> $DIR/where-allowed.rs:191:15
281 LL | where Vec<impl Debug>: Debug
284 = note: found `impl Trait` in type
286 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
287 --> $DIR/where-allowed.rs:198:24
289 LL | where T: PartialEq<impl Debug>
292 = note: found `impl Trait` in bound
294 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
295 --> $DIR/where-allowed.rs:205:17
297 LL | where T: Fn(impl Debug)
300 = note: found `impl Trait` in `Fn` trait param
302 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
303 --> $DIR/where-allowed.rs:212:22
305 LL | where T: Fn() -> impl Debug
308 = note: found `impl Trait` in `Fn` trait return
310 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
311 --> $DIR/where-allowed.rs:218:40
313 LL | struct InStructGenericParamDefault<T = impl Debug>(T);
316 = note: found `impl Trait` in type
318 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
319 --> $DIR/where-allowed.rs:222:36
321 LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
324 = note: found `impl Trait` in type
326 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
327 --> $DIR/where-allowed.rs:226:38
329 LL | trait InTraitGenericParamDefault<T = impl Debug> {}
332 = note: found `impl Trait` in type
334 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
335 --> $DIR/where-allowed.rs:230:41
337 LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
340 = note: found `impl Trait` in type
342 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
343 --> $DIR/where-allowed.rs:234:11
345 LL | impl <T = impl Debug> T {}
348 = note: found `impl Trait` in type
350 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
351 --> $DIR/where-allowed.rs:241:40
353 LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
356 = note: found `impl Trait` in type
358 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
359 --> $DIR/where-allowed.rs:247:29
361 LL | let _in_local_variable: impl Fn() = || {};
364 = note: found `impl Trait` in variable
366 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
367 --> $DIR/where-allowed.rs:249:46
369 LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
372 = note: found `impl Trait` in closure return
374 error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
375 --> $DIR/where-allowed.rs:234:7
377 LL | impl <T = impl Debug> T {}
380 = note: `#[deny(invalid_type_param_default)]` on by default
381 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
382 = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
384 error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
385 --> $DIR/where-allowed.rs:241:36
387 LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
390 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
391 = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
393 error[E0118]: no nominal type found for inherent implementation
394 --> $DIR/where-allowed.rs:234:23
396 LL | impl <T = impl Debug> T {}
397 | ^ impl requires a nominal type
399 = note: either implement a trait on it or create a newtype to wrap it instead
401 error: aborting due to 49 previous errors
403 Some errors have detailed explanations: E0118, E0562, E0658, E0666.
404 For more information about an error, try `rustc --explain E0118`.