Add test.
This commit is contained in:
parent
8f08b3a324
commit
313dff14b9
1 changed files with 12 additions and 0 deletions
12
tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs
Normal file
12
tests/ui/lifetimes/elided-lifetime-in-const-param-type.rs
Normal 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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue