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:121: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:157: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:161: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 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
53 --> $DIR/where-allowed.rs:19:42
55 LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
58 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
59 --> $DIR/where-allowed.rs:23:38
61 LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
64 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
65 --> $DIR/where-allowed.rs:27:40
67 LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
70 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
71 --> $DIR/where-allowed.rs:31:49
73 LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
76 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
77 --> $DIR/where-allowed.rs:35:51
79 LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
82 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
83 --> $DIR/where-allowed.rs:39:55
85 LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
88 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
89 --> $DIR/where-allowed.rs:43:57
91 LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
94 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
95 --> $DIR/where-allowed.rs:47:51
97 LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
100 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
101 --> $DIR/where-allowed.rs:52:53
103 LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
106 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
107 --> $DIR/where-allowed.rs:56:57
109 LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
112 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
113 --> $DIR/where-allowed.rs:62:59
115 LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
118 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
119 --> $DIR/where-allowed.rs:67:38
121 LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
124 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
125 --> $DIR/where-allowed.rs:71:40
127 LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
130 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
131 --> $DIR/where-allowed.rs:84:32
133 LL | struct InBraceStructField { x: impl Debug }
136 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
137 --> $DIR/where-allowed.rs:88:41
139 LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
142 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
143 --> $DIR/where-allowed.rs:92:27
145 LL | struct InTupleStructField(impl Debug);
148 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
149 --> $DIR/where-allowed.rs:97:25
151 LL | InBraceVariant { x: impl Debug },
154 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
155 --> $DIR/where-allowed.rs:99:20
157 LL | InTupleVariant(impl Debug),
160 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
161 --> $DIR/where-allowed.rs:110:23
163 LL | fn in_return() -> impl Debug;
166 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
167 --> $DIR/where-allowed.rs:128:34
169 LL | fn in_trait_impl_return() -> impl Debug { () }
172 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
173 --> $DIR/where-allowed.rs:141:33
175 LL | fn in_foreign_parameters(_: impl Debug);
178 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
179 --> $DIR/where-allowed.rs:144:31
181 LL | fn in_foreign_return() -> impl Debug;
184 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
185 --> $DIR/where-allowed.rs:161:39
187 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
190 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
191 --> $DIR/where-allowed.rs:166:16
193 LL | impl PartialEq<impl Debug> for () {
196 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
197 --> $DIR/where-allowed.rs:171:24
199 LL | impl PartialEq<()> for impl Debug {
202 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
203 --> $DIR/where-allowed.rs:176:6
205 LL | impl impl Debug {
208 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
209 --> $DIR/where-allowed.rs:182:24
211 LL | impl InInherentImplAdt<impl Debug> {
214 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
215 --> $DIR/where-allowed.rs:188:11
217 LL | where impl Debug: Debug
220 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
221 --> $DIR/where-allowed.rs:195:15
223 LL | where Vec<impl Debug>: Debug
226 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
227 --> $DIR/where-allowed.rs:202:24
229 LL | where T: PartialEq<impl Debug>
232 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
233 --> $DIR/where-allowed.rs:209:17
235 LL | where T: Fn(impl Debug)
238 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
239 --> $DIR/where-allowed.rs:216:22
241 LL | where T: Fn() -> impl Debug
244 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
245 --> $DIR/where-allowed.rs:222:29
247 LL | let _in_local_variable: impl Fn() = || {};
250 = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
252 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
253 --> $DIR/where-allowed.rs:224:46
255 LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
258 error[E0720]: cannot resolve opaque type
259 --> $DIR/where-allowed.rs:56:49
261 LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
262 | ^^^^^^^^^^^^^^^^^^^ -------- this returned value is of `!` type
264 | cannot resolve opaque type
266 = help: this error will resolve once the item's body returns a concrete type
268 error[E0720]: cannot resolve opaque type
269 --> $DIR/where-allowed.rs:62:46
271 LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
272 | ^^^^^^^^^^^^^^^^^^^^^^^ -------- this returned value is of `!` type
274 | cannot resolve opaque type
276 = help: this error will resolve once the item's body returns a concrete type
278 error: could not find defining uses
279 --> $DIR/where-allowed.rs:121:16
281 LL | type Out = impl Debug;
284 error: could not find defining uses
285 --> $DIR/where-allowed.rs:157:23
287 LL | type InTypeAlias<R> = impl Debug;
290 error: aborting due to 44 previous errors
292 Some errors have detailed explanations: E0562, E0658, E0666, E0720.
293 For more information about an error, try `rustc --explain E0562`.