@@ -241,21 +241,21 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
241
241
| ^^
242
242
243
243
error[E0747]: unresolved item provided when a constant was expected
244
- --> $DIR/const-arg-in-const-arg.rs:27:23
244
+ --> $DIR/const-arg-in-const-arg.rs:38:24
245
245
|
246
- LL | let _ = [0; bar::<N>()] ;
247
- | ^
246
+ LL | let _: Foo<{ bar::<N>() }> ;
247
+ | ^
248
248
|
249
249
help: if this generic argument was intended as a const parameter, surround it with braces
250
250
|
251
- LL | let _ = [0; bar::<{ N }>()] ;
252
- | + +
251
+ LL | let _: Foo<{ bar::<{ N }>() }> ;
252
+ | + +
253
253
254
254
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
255
- --> $DIR/const-arg-in-const-arg.rs:30:23
255
+ --> $DIR/const-arg-in-const-arg.rs:41:24
256
256
|
257
- LL | let _ = [0; faz::<'a>(&())] ;
258
- | ^^
257
+ LL | let _: Foo<{ faz::<'a>(&()) }> ;
258
+ | ^^
259
259
|
260
260
note: the late bound lifetime parameter is introduced here
261
261
--> $DIR/const-arg-in-const-arg.rs:8:14
@@ -264,33 +264,41 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
264
264
| ^^
265
265
266
266
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
267
- --> $DIR/const-arg-in-const-arg.rs:33:23
267
+ --> $DIR/const-arg-in-const-arg.rs:44:24
268
268
|
269
- LL | let _ = [0; faz::<'b>(&())] ;
270
- | ^^
269
+ LL | let _: Foo<{ faz::<'b>(&()) }> ;
270
+ | ^^
271
271
|
272
272
note: the late bound lifetime parameter is introduced here
273
273
--> $DIR/const-arg-in-const-arg.rs:8:14
274
274
|
275
275
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
276
276
| ^^
277
277
278
+ error: constant expression depends on a generic parameter
279
+ --> $DIR/const-arg-in-const-arg.rs:25:17
280
+ |
281
+ LL | let _ = [0; foo::<T>()];
282
+ | ^^^^^^^^^^
283
+ |
284
+ = note: this may fail depending on what value the parameter takes
285
+
278
286
error[E0747]: unresolved item provided when a constant was expected
279
- --> $DIR/const-arg-in-const-arg.rs:38:24
287
+ --> $DIR/const-arg-in-const-arg.rs:27:23
280
288
|
281
- LL | let _: Foo<{ bar::<N>() }> ;
282
- | ^
289
+ LL | let _ = [0; bar::<N>()] ;
290
+ | ^
283
291
|
284
292
help: if this generic argument was intended as a const parameter, surround it with braces
285
293
|
286
- LL | let _: Foo<{ bar::<{ N }>() }> ;
287
- | + +
294
+ LL | let _ = [0; bar::<{ N }>()] ;
295
+ | + +
288
296
289
297
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
290
- --> $DIR/const-arg-in-const-arg.rs:41:24
298
+ --> $DIR/const-arg-in-const-arg.rs:30:23
291
299
|
292
- LL | let _: Foo<{ faz::<'a>(&()) }> ;
293
- | ^^
300
+ LL | let _ = [0; faz::<'a>(&())] ;
301
+ | ^^
294
302
|
295
303
note: the late bound lifetime parameter is introduced here
296
304
--> $DIR/const-arg-in-const-arg.rs:8:14
@@ -299,25 +307,17 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
299
307
| ^^
300
308
301
309
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
302
- --> $DIR/const-arg-in-const-arg.rs:44:24
310
+ --> $DIR/const-arg-in-const-arg.rs:33:23
303
311
|
304
- LL | let _: Foo<{ faz::<'b>(&()) }> ;
305
- | ^^
312
+ LL | let _ = [0; faz::<'b>(&())] ;
313
+ | ^^
306
314
|
307
315
note: the late bound lifetime parameter is introduced here
308
316
--> $DIR/const-arg-in-const-arg.rs:8:14
309
317
|
310
318
LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
311
319
| ^^
312
320
313
- error: constant expression depends on a generic parameter
314
- --> $DIR/const-arg-in-const-arg.rs:25:17
315
- |
316
- LL | let _ = [0; foo::<T>()];
317
- | ^^^^^^^^^^
318
- |
319
- = note: this may fail depending on what value the parameter takes
320
-
321
321
error[E0747]: unresolved item provided when a constant was expected
322
322
--> $DIR/const-arg-in-const-arg.rs:49:27
323
323
|
0 commit comments