From 313dff14b93beab9d526e41563eb99135e96060c Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Fri, 4 Jul 2025 16:08:36 +0000 Subject: [PATCH] Add test. --- .../lifetimes/elided-lifetime-in-const-param-type.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs diff --git a/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs new file mode 100644 index 000000000000..cdfd1327eaed --- /dev/null +++ b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs @@ -0,0 +1,12 @@ +//! Regression test for +//! 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 D; +//~^ ERROR cannot find type `c` in this scope +//~| ERROR only lifetime parameters can be used in this context + +fn main() {}