diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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 00000000000..cdfd1327eae --- /dev/null +++ b/tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs @@ -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() {} |
