]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/where-allowed.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / impl-trait / where-allowed.stderr
CommitLineData
b7449926 1error[E0666]: nested `impl Trait` is not allowed
60c5eb7d 2 --> $DIR/where-allowed.rs:47:51
b7449926
XL
3 |
4LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
5 | --------^^^^^^^^^^-
6 | | |
7 | | nested `impl Trait` here
8 | outer `impl Trait`
9
10error[E0666]: nested `impl Trait` is not allowed
60c5eb7d 11 --> $DIR/where-allowed.rs:56:57
b7449926
XL
12 |
13LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
14 | --------^^^^^^^^^^-
15 | | |
16 | | nested `impl Trait` here
17 | outer `impl Trait`
18
416331ca 19error[E0658]: `impl Trait` in type aliases is unstable
cdc7bbd5 20 --> $DIR/where-allowed.rs:119:16
416331ca
XL
21 |
22LL | type Out = impl Debug;
60c5eb7d 23 | ^^^^^^^^^^
416331ca 24 |
74b04a01 25 = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
94222f64 26 = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
416331ca
XL
27
28error[E0658]: `impl Trait` in type aliases is unstable
cdc7bbd5 29 --> $DIR/where-allowed.rs:154:23
416331ca
XL
30 |
31LL | type InTypeAlias<R> = impl Debug;
60c5eb7d
XL
32 | ^^^^^^^^^^
33 |
74b04a01 34 = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
94222f64 35 = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
60c5eb7d
XL
36
37error[E0658]: `impl Trait` in type aliases is unstable
cdc7bbd5 38 --> $DIR/where-allowed.rs:157:39
60c5eb7d
XL
39 |
40LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
41 | ^^^^^^^^^^
416331ca 42 |
74b04a01 43 = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
94222f64 44 = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
416331ca 45
136023e0 46error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 47 --> $DIR/where-allowed.rs:15:40
b7449926
XL
48 |
49LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
50 | ^^^^^^^^^^
51
136023e0 52error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 53 --> $DIR/where-allowed.rs:19:42
b7449926
XL
54 |
55LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
56 | ^^^^^^^^^^
57
136023e0 58error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 59 --> $DIR/where-allowed.rs:23:38
b7449926
XL
60 |
61LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
62 | ^^^^^^^^^^
63
136023e0 64error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 65 --> $DIR/where-allowed.rs:27:40
b7449926
XL
66 |
67LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
68 | ^^^^^^^^^^
69
136023e0 70error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 71 --> $DIR/where-allowed.rs:31:49
b7449926
XL
72 |
73LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
74 | ^^^^^^^^^^
75
136023e0 76error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 77 --> $DIR/where-allowed.rs:35:51
b7449926
XL
78 |
79LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
80 | ^^^^^^^^^^
81
136023e0 82error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 83 --> $DIR/where-allowed.rs:39:55
b7449926
XL
84 |
85LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
86 | ^^^^^^^^^^
87
136023e0 88error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 89 --> $DIR/where-allowed.rs:43:57
b7449926
XL
90 |
91LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
92 | ^^^^^^^^^^
93
136023e0 94error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 95 --> $DIR/where-allowed.rs:47:51
b7449926
XL
96 |
97LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
98 | ^^^^^^^^^^
99
136023e0 100error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 101 --> $DIR/where-allowed.rs:52:53
b7449926
XL
102 |
103LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
104 | ^^^^^^^^^^
105
136023e0 106error[E0562]: `impl Trait` not allowed outside of function and method return types
60c5eb7d 107 --> $DIR/where-allowed.rs:56:57
b7449926
XL
108 |
109LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
110 | ^^^^^^^^^^
111
136023e0 112error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 113 --> $DIR/where-allowed.rs:61:59
b7449926
XL
114 |
115LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
116 | ^^^^^^^^^^
117
136023e0 118error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 119 --> $DIR/where-allowed.rs:65:38
b7449926
XL
120 |
121LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
122 | ^^^^^^^^^^
123
136023e0 124error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 125 --> $DIR/where-allowed.rs:69:40
b7449926
XL
126 |
127LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
128 | ^^^^^^^^^^
129
136023e0 130error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 131 --> $DIR/where-allowed.rs:82:32
b7449926
XL
132 |
133LL | struct InBraceStructField { x: impl Debug }
134 | ^^^^^^^^^^
135
136023e0 136error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 137 --> $DIR/where-allowed.rs:86:41
b7449926
XL
138 |
139LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
140 | ^^^^^^^^^^
141
136023e0 142error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 143 --> $DIR/where-allowed.rs:90:27
b7449926
XL
144 |
145LL | struct InTupleStructField(impl Debug);
146 | ^^^^^^^^^^
147
136023e0 148error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 149 --> $DIR/where-allowed.rs:95:25
b7449926
XL
150 |
151LL | InBraceVariant { x: impl Debug },
152 | ^^^^^^^^^^
153
136023e0 154error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 155 --> $DIR/where-allowed.rs:97:20
b7449926
XL
156 |
157LL | InTupleVariant(impl Debug),
158 | ^^^^^^^^^^
159
136023e0 160error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 161 --> $DIR/where-allowed.rs:108:23
b7449926
XL
162 |
163LL | fn in_return() -> impl Debug;
164 | ^^^^^^^^^^
165
136023e0 166error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 167 --> $DIR/where-allowed.rs:125:34
b7449926
XL
168 |
169LL | fn in_trait_impl_return() -> impl Debug { () }
170 | ^^^^^^^^^^
171
136023e0 172error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 173 --> $DIR/where-allowed.rs:138:33
b7449926
XL
174 |
175LL | fn in_foreign_parameters(_: impl Debug);
176 | ^^^^^^^^^^
177
136023e0 178error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 179 --> $DIR/where-allowed.rs:141:31
b7449926
XL
180 |
181LL | fn in_foreign_return() -> impl Debug;
182 | ^^^^^^^^^^
183
136023e0 184error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 185 --> $DIR/where-allowed.rs:157:39
b7449926
XL
186 |
187LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
188 | ^^^^^^^^^^
189
136023e0 190error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 191 --> $DIR/where-allowed.rs:162:16
b7449926
XL
192 |
193LL | impl PartialEq<impl Debug> for () {
194 | ^^^^^^^^^^
195
136023e0 196error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 197 --> $DIR/where-allowed.rs:167:24
b7449926
XL
198 |
199LL | impl PartialEq<()> for impl Debug {
200 | ^^^^^^^^^^
201
136023e0 202error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 203 --> $DIR/where-allowed.rs:172:6
b7449926
XL
204 |
205LL | impl impl Debug {
206 | ^^^^^^^^^^
207
136023e0 208error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 209 --> $DIR/where-allowed.rs:178:24
b7449926
XL
210 |
211LL | impl InInherentImplAdt<impl Debug> {
212 | ^^^^^^^^^^
213
136023e0 214error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 215 --> $DIR/where-allowed.rs:184:11
b7449926
XL
216 |
217LL | where impl Debug: Debug
218 | ^^^^^^^^^^
219
136023e0 220error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 221 --> $DIR/where-allowed.rs:191:15
b7449926
XL
222 |
223LL | where Vec<impl Debug>: Debug
224 | ^^^^^^^^^^
225
136023e0 226error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 227 --> $DIR/where-allowed.rs:198:24
b7449926
XL
228 |
229LL | where T: PartialEq<impl Debug>
230 | ^^^^^^^^^^
231
136023e0 232error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 233 --> $DIR/where-allowed.rs:205:17
b7449926
XL
234 |
235LL | where T: Fn(impl Debug)
236 | ^^^^^^^^^^
237
136023e0 238error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 239 --> $DIR/where-allowed.rs:212:22
b7449926
XL
240 |
241LL | where T: Fn() -> impl Debug
242 | ^^^^^^^^^^
243
136023e0 244error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5
XL
245 --> $DIR/where-allowed.rs:218:40
246 |
247LL | struct InStructGenericParamDefault<T = impl Debug>(T);
248 | ^^^^^^^^^^
249
136023e0 250error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5
XL
251 --> $DIR/where-allowed.rs:222:36
252 |
253LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
254 | ^^^^^^^^^^
255
136023e0 256error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5
XL
257 --> $DIR/where-allowed.rs:226:38
258 |
259LL | trait InTraitGenericParamDefault<T = impl Debug> {}
260 | ^^^^^^^^^^
261
136023e0 262error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5
XL
263 --> $DIR/where-allowed.rs:230:41
264 |
265LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
266 | ^^^^^^^^^^
267
136023e0 268error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5
XL
269 --> $DIR/where-allowed.rs:234:11
270 |
271LL | impl <T = impl Debug> T {}
272 | ^^^^^^^^^^
273
136023e0 274error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5
XL
275 --> $DIR/where-allowed.rs:240:40
276 |
277LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
278 | ^^^^^^^^^^
279
136023e0 280error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 281 --> $DIR/where-allowed.rs:246:29
b7449926
XL
282 |
283LL | let _in_local_variable: impl Fn() = || {};
284 | ^^^^^^^^^
285
136023e0 286error[E0562]: `impl Trait` not allowed outside of function and method return types
cdc7bbd5 287 --> $DIR/where-allowed.rs:248:46
b7449926
XL
288 |
289LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
290 | ^^^^^^^^^
291
cdc7bbd5
XL
292error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
293 --> $DIR/where-allowed.rs:234:7
1b1a35ee 294 |
cdc7bbd5
XL
295LL | impl <T = impl Debug> T {}
296 | ^
1b1a35ee 297 |
cdc7bbd5
XL
298 = note: `#[deny(invalid_type_param_default)]` on by default
299 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
300 = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
1b1a35ee 301
cdc7bbd5
XL
302error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
303 --> $DIR/where-allowed.rs:240:36
416331ca 304 |
cdc7bbd5
XL
305LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
306 | ^
416331ca 307 |
cdc7bbd5
XL
308 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
309 = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
416331ca 310
cdc7bbd5 311error: aborting due to 48 previous errors
b7449926 312
cdc7bbd5 313Some errors have detailed explanations: E0562, E0658, E0666.
60c5eb7d 314For more information about an error, try `rustc --explain E0562`.