@@ -17,7 +17,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
17
17
| outer `impl Trait`
18
18
19
19
error[E0658]: `impl Trait` in associated types is unstable
20
- --> $DIR/where-allowed.rs:122 :16
20
+ --> $DIR/where-allowed.rs:121 :16
21
21
|
22
22
LL | type Out = impl Debug;
23
23
| ^^^^^^^^^^
@@ -27,7 +27,7 @@ LL | type Out = impl Debug;
27
27
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
28
28
29
29
error[E0658]: `impl Trait` in type aliases is unstable
30
- --> $DIR/where-allowed.rs:159 :23
30
+ --> $DIR/where-allowed.rs:158 :23
31
31
|
32
32
LL | type InTypeAlias<R> = impl Debug;
33
33
| ^^^^^^^^^^
@@ -37,7 +37,7 @@ LL | type InTypeAlias<R> = impl Debug;
37
37
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
38
38
39
39
error[E0658]: `impl Trait` in type aliases is unstable
40
- --> $DIR/where-allowed.rs:162 :39
40
+ --> $DIR/where-allowed.rs:161 :39
41
41
|
42
42
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
43
43
| ^^^^^^^^^^
@@ -143,199 +143,199 @@ LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
143
143
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
144
144
145
145
error[E0562]: `impl Trait` is not allowed in field types
146
- --> $DIR/where-allowed.rs:86 :32
146
+ --> $DIR/where-allowed.rs:85 :32
147
147
|
148
148
LL | struct InBraceStructField { x: impl Debug }
149
149
| ^^^^^^^^^^
150
150
|
151
151
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
152
152
153
153
error[E0562]: `impl Trait` is not allowed in field types
154
- --> $DIR/where-allowed.rs:90 :41
154
+ --> $DIR/where-allowed.rs:89 :41
155
155
|
156
156
LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
157
157
| ^^^^^^^^^^
158
158
|
159
159
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
160
160
161
161
error[E0562]: `impl Trait` is not allowed in field types
162
- --> $DIR/where-allowed.rs:94 :27
162
+ --> $DIR/where-allowed.rs:93 :27
163
163
|
164
164
LL | struct InTupleStructField(impl Debug);
165
165
| ^^^^^^^^^^
166
166
|
167
167
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
168
168
169
169
error[E0562]: `impl Trait` is not allowed in field types
170
- --> $DIR/where-allowed.rs:99 :25
170
+ --> $DIR/where-allowed.rs:98 :25
171
171
|
172
172
LL | InBraceVariant { x: impl Debug },
173
173
| ^^^^^^^^^^
174
174
|
175
175
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
176
176
177
177
error[E0562]: `impl Trait` is not allowed in field types
178
- --> $DIR/where-allowed.rs:101 :20
178
+ --> $DIR/where-allowed.rs:100 :20
179
179
|
180
180
LL | InTupleVariant(impl Debug),
181
181
| ^^^^^^^^^^
182
182
|
183
183
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
184
184
185
185
error[E0562]: `impl Trait` is not allowed in `extern fn` parameters
186
- --> $DIR/where-allowed.rs:143 :33
186
+ --> $DIR/where-allowed.rs:142 :33
187
187
|
188
188
LL | fn in_foreign_parameters(_: impl Debug);
189
189
| ^^^^^^^^^^
190
190
|
191
191
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
192
192
193
193
error[E0562]: `impl Trait` is not allowed in `extern fn` return types
194
- --> $DIR/where-allowed.rs:146 :31
194
+ --> $DIR/where-allowed.rs:145 :31
195
195
|
196
196
LL | fn in_foreign_return() -> impl Debug;
197
197
| ^^^^^^^^^^
198
198
|
199
199
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
200
200
201
201
error[E0562]: `impl Trait` is not allowed in `fn` pointer return types
202
- --> $DIR/where-allowed.rs:162 :39
202
+ --> $DIR/where-allowed.rs:161 :39
203
203
|
204
204
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
205
205
| ^^^^^^^^^^
206
206
|
207
207
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
208
208
209
209
error[E0562]: `impl Trait` is not allowed in traits
210
- --> $DIR/where-allowed.rs:167 :16
210
+ --> $DIR/where-allowed.rs:166 :16
211
211
|
212
212
LL | impl PartialEq<impl Debug> for () {
213
213
| ^^^^^^^^^^
214
214
|
215
215
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
216
216
217
217
error[E0562]: `impl Trait` is not allowed in impl headers
218
- --> $DIR/where-allowed.rs:172 :24
218
+ --> $DIR/where-allowed.rs:171 :24
219
219
|
220
220
LL | impl PartialEq<()> for impl Debug {
221
221
| ^^^^^^^^^^
222
222
|
223
223
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
224
224
225
225
error[E0562]: `impl Trait` is not allowed in impl headers
226
- --> $DIR/where-allowed.rs:177 :6
226
+ --> $DIR/where-allowed.rs:176 :6
227
227
|
228
228
LL | impl impl Debug {
229
229
| ^^^^^^^^^^
230
230
|
231
231
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
232
232
233
233
error[E0562]: `impl Trait` is not allowed in impl headers
234
- --> $DIR/where-allowed.rs:183 :24
234
+ --> $DIR/where-allowed.rs:182 :24
235
235
|
236
236
LL | impl InInherentImplAdt<impl Debug> {
237
237
| ^^^^^^^^^^
238
238
|
239
239
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
240
240
241
241
error[E0562]: `impl Trait` is not allowed in bounds
242
- --> $DIR/where-allowed.rs:189 :11
242
+ --> $DIR/where-allowed.rs:188 :11
243
243
|
244
244
LL | where impl Debug: Debug
245
245
| ^^^^^^^^^^
246
246
|
247
247
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
248
248
249
249
error[E0562]: `impl Trait` is not allowed in bounds
250
- --> $DIR/where-allowed.rs:196 :15
250
+ --> $DIR/where-allowed.rs:195 :15
251
251
|
252
252
LL | where Vec<impl Debug>: Debug
253
253
| ^^^^^^^^^^
254
254
|
255
255
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
256
256
257
257
error[E0562]: `impl Trait` is not allowed in bounds
258
- --> $DIR/where-allowed.rs:203 :24
258
+ --> $DIR/where-allowed.rs:202 :24
259
259
|
260
260
LL | where T: PartialEq<impl Debug>
261
261
| ^^^^^^^^^^
262
262
|
263
263
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
264
264
265
265
error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
266
- --> $DIR/where-allowed.rs:210 :17
266
+ --> $DIR/where-allowed.rs:209 :17
267
267
|
268
268
LL | where T: Fn(impl Debug)
269
269
| ^^^^^^^^^^
270
270
|
271
271
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
272
272
273
273
error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds
274
- --> $DIR/where-allowed.rs:217 :22
274
+ --> $DIR/where-allowed.rs:216 :22
275
275
|
276
276
LL | where T: Fn() -> impl Debug
277
277
| ^^^^^^^^^^
278
278
|
279
279
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
280
280
281
281
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
282
- --> $DIR/where-allowed.rs:223 :40
282
+ --> $DIR/where-allowed.rs:222 :40
283
283
|
284
284
LL | struct InStructGenericParamDefault<T = impl Debug>(T);
285
285
| ^^^^^^^^^^
286
286
|
287
287
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
288
288
289
289
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
290
- --> $DIR/where-allowed.rs:227 :36
290
+ --> $DIR/where-allowed.rs:226 :36
291
291
|
292
292
LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
293
293
| ^^^^^^^^^^
294
294
|
295
295
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
296
296
297
297
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
298
- --> $DIR/where-allowed.rs:231 :38
298
+ --> $DIR/where-allowed.rs:230 :38
299
299
|
300
300
LL | trait InTraitGenericParamDefault<T = impl Debug> {}
301
301
| ^^^^^^^^^^
302
302
|
303
303
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
304
304
305
305
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
306
- --> $DIR/where-allowed.rs:235 :41
306
+ --> $DIR/where-allowed.rs:234 :41
307
307
|
308
308
LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
309
309
| ^^^^^^^^^^
310
310
|
311
311
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
312
312
313
313
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
314
- --> $DIR/where-allowed.rs:239 :11
314
+ --> $DIR/where-allowed.rs:238 :11
315
315
|
316
316
LL | impl <T = impl Debug> T {}
317
317
| ^^^^^^^^^^
318
318
|
319
319
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
320
320
321
321
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
322
- --> $DIR/where-allowed.rs:246 :40
322
+ --> $DIR/where-allowed.rs:245 :40
323
323
|
324
324
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
325
325
| ^^^^^^^^^^
326
326
|
327
327
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
328
328
329
329
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
330
- --> $DIR/where-allowed.rs:252 :29
330
+ --> $DIR/where-allowed.rs:251 :29
331
331
|
332
332
LL | let _in_local_variable: impl Fn() = || {};
333
333
| ^^^^^^^^^
334
334
|
335
335
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
336
336
337
337
error[E0562]: `impl Trait` is not allowed in closure return types
338
- --> $DIR/where-allowed.rs:254 :46
338
+ --> $DIR/where-allowed.rs:253 :46
339
339
|
340
340
LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
341
341
| ^^^^^^^^^
@@ -363,7 +363,7 @@ LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { pani
363
363
where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;
364
364
365
365
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
366
- --> $DIR/where-allowed.rs:239 :7
366
+ --> $DIR/where-allowed.rs:238 :7
367
367
|
368
368
LL | impl <T = impl Debug> T {}
369
369
| ^^^^^^^^^^^^^^
@@ -373,25 +373,15 @@ LL | impl <T = impl Debug> T {}
373
373
= note: `#[deny(invalid_type_param_default)]` on by default
374
374
375
375
error[E0118]: no nominal type found for inherent implementation
376
- --> $DIR/where-allowed.rs:239 :1
376
+ --> $DIR/where-allowed.rs:238 :1
377
377
|
378
378
LL | impl <T = impl Debug> T {}
379
379
| ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
380
380
|
381
381
= note: either implement a trait on it or create a newtype to wrap it instead
382
382
383
- error[E0599]: no function or associated item named `into_vec` found for slice `[_]` in the current scope
384
- --> $DIR/where-allowed.rs:81:5
385
- |
386
- LL | vec![vec![0; 10], vec![12; 7], vec![8; 3]]
387
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `[_]`
388
- |
389
- help: there is an associated function `to_vec` with a similar name
390
- --> $SRC_DIR/alloc/src/slice.rs:LL:COL
391
- = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
392
-
393
383
error[E0053]: method `in_trait_impl_return` has an incompatible type for trait
394
- --> $DIR/where-allowed.rs:129 :34
384
+ --> $DIR/where-allowed.rs:128 :34
395
385
|
396
386
LL | type Out = impl Debug;
397
387
| ---------- the expected opaque type
@@ -400,7 +390,7 @@ LL | fn in_trait_impl_return() -> impl Debug { () }
400
390
| ^^^^^^^^^^ expected opaque type, found a different opaque type
401
391
|
402
392
note: type in trait
403
- --> $DIR/where-allowed.rs:119 :34
393
+ --> $DIR/where-allowed.rs:118 :34
404
394
|
405
395
LL | fn in_trait_impl_return() -> Self::Out;
406
396
| ^^^^^^^^^
@@ -413,29 +403,29 @@ LL | fn in_trait_impl_return() -> <() as DummyTrait>::Out { () }
413
403
| ~~~~~~~~~~~~~~~~~~~~~~~
414
404
415
405
error: unconstrained opaque type
416
- --> $DIR/where-allowed.rs:122 :16
406
+ --> $DIR/where-allowed.rs:121 :16
417
407
|
418
408
LL | type Out = impl Debug;
419
409
| ^^^^^^^^^^
420
410
|
421
411
= note: `Out` must be used in combination with a concrete type within the same impl
422
412
423
413
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
424
- --> $DIR/where-allowed.rs:246 :36
414
+ --> $DIR/where-allowed.rs:245 :36
425
415
|
426
416
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
427
417
| ^^^^^^^^^^^^^^
428
418
|
429
419
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
430
420
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
431
421
432
- error: aborting due to 50 previous errors
422
+ error: aborting due to 49 previous errors
433
423
434
- Some errors have detailed explanations: E0053, E0118, E0283, E0562, E0599, E0658, E0666.
424
+ Some errors have detailed explanations: E0053, E0118, E0283, E0562, E0658, E0666.
435
425
For more information about an error, try `rustc --explain E0053`.
436
426
Future incompatibility report: Future breakage diagnostic:
437
427
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
438
- --> $DIR/where-allowed.rs:239 :7
428
+ --> $DIR/where-allowed.rs:238 :7
439
429
|
440
430
LL | impl <T = impl Debug> T {}
441
431
| ^^^^^^^^^^^^^^
@@ -446,7 +436,7 @@ LL | impl <T = impl Debug> T {}
446
436
447
437
Future breakage diagnostic:
448
438
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
449
- --> $DIR/where-allowed.rs:246 :36
439
+ --> $DIR/where-allowed.rs:245 :36
450
440
|
451
441
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
452
442
| ^^^^^^^^^^^^^^
0 commit comments