mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 13:36:49 +00:00
add test
This commit is contained in:
parent
093b9d5b29
commit
2e000ebaa5
16
tests/ui/typeck/escaping_bound_vars.rs
Normal file
16
tests/ui/typeck/escaping_bound_vars.rs
Normal file
@ -0,0 +1,16 @@
|
||||
// Test for issues/115517 which is fixed by pull/115486
|
||||
// This should not ice
|
||||
trait Test<const C: usize> {}
|
||||
|
||||
trait Elide<T> {
|
||||
fn call();
|
||||
}
|
||||
|
||||
pub fn test()
|
||||
where
|
||||
(): Test<{ 1 + (<() as Elide(&())>::call) }>,
|
||||
//~^ ERROR cannot capture late-bound lifetime in constant
|
||||
{
|
||||
}
|
||||
|
||||
fn main() {}
|
10
tests/ui/typeck/escaping_bound_vars.stderr
Normal file
10
tests/ui/typeck/escaping_bound_vars.stderr
Normal file
@ -0,0 +1,10 @@
|
||||
error: cannot capture late-bound lifetime in constant
|
||||
--> $DIR/escaping_bound_vars.rs:11:35
|
||||
|
|
||||
LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>,
|
||||
| -^
|
||||
| |
|
||||
| lifetime defined here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user