Add test.

This commit is contained in:
Camille GILLOT 2025-07-04 16:08:36 +00:00
parent 8f08b3a324
commit 313dff14b9

View file

@ -0,0 +1,12 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/143413>
//! The anonymous lifetime in `c(&())` is desugared by the resolver as an extra lifetime parameter
//! at the end of the `for` binder. Verify that lowering creates the definition for that extra
//! lifetime parameter before lowering `c(&())`.
trait D {}
type A = dyn for<const B: c(&())> D;
//~^ ERROR cannot find type `c` in this scope
//~| ERROR only lifetime parameters can be used in this context
fn main() {}