@@ -241,21 +241,21 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
241241 | ^^
242242
243243error[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
245245 |
246- LL | let _ = [0; bar::<N>()] ;
247- | ^
246+ LL | let _: Foo<{ bar::<N>() }> ;
247+ | ^
248248 |
249249help: if this generic argument was intended as a const parameter, surround it with braces
250250 |
251- LL | let _ = [0; bar::<{ N }>()] ;
252- | + +
251+ LL | let _: Foo<{ bar::<{ N }>() }> ;
252+ | + +
253253
254254error: 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
256256 |
257- LL | let _ = [0; faz::<'a>(&())] ;
258- | ^^
257+ LL | let _: Foo<{ faz::<'a>(&()) }> ;
258+ | ^^
259259 |
260260note: the late bound lifetime parameter is introduced here
261261 --> $DIR/const-arg-in-const-arg.rs:8:14
@@ -264,33 +264,41 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
264264 | ^^
265265
266266error: 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
268268 |
269- LL | let _ = [0; faz::<'b>(&())] ;
270- | ^^
269+ LL | let _: Foo<{ faz::<'b>(&()) }> ;
270+ | ^^
271271 |
272272note: the late bound lifetime parameter is introduced here
273273 --> $DIR/const-arg-in-const-arg.rs:8:14
274274 |
275275LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
276276 | ^^
277277
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+
278286error[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
280288 |
281- LL | let _: Foo<{ bar::<N>() }> ;
282- | ^
289+ LL | let _ = [0; bar::<N>()] ;
290+ | ^
283291 |
284292help: if this generic argument was intended as a const parameter, surround it with braces
285293 |
286- LL | let _: Foo<{ bar::<{ N }>() }> ;
287- | + +
294+ LL | let _ = [0; bar::<{ N }>()] ;
295+ | + +
288296
289297error: 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
291299 |
292- LL | let _: Foo<{ faz::<'a>(&()) }> ;
293- | ^^
300+ LL | let _ = [0; faz::<'a>(&())] ;
301+ | ^^
294302 |
295303note: the late bound lifetime parameter is introduced here
296304 --> $DIR/const-arg-in-const-arg.rs:8:14
@@ -299,25 +307,17 @@ LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
299307 | ^^
300308
301309error: 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
303311 |
304- LL | let _: Foo<{ faz::<'b>(&()) }> ;
305- | ^^
312+ LL | let _ = [0; faz::<'b>(&())] ;
313+ | ^^
306314 |
307315note: the late bound lifetime parameter is introduced here
308316 --> $DIR/const-arg-in-const-arg.rs:8:14
309317 |
310318LL | const fn faz<'a>(_: &'a ()) -> usize { 13 }
311319 | ^^
312320
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-
321321error[E0747]: unresolved item provided when a constant was expected
322322 --> $DIR/const-arg-in-const-arg.rs:49:27
323323 |
0 commit comments