Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ouz-a committed Oct 9, 2023
1 parent 093b9d5 commit 188d8c9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/ui/typeck/escaping_bound_vars.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions tests/ui/typeck/escaping_bound_vars.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: cannot capture late-bound lifetime in constant
--> $DIR/escaping_bound_vars.rs:12:35
|
LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>,
| -^
| |
| lifetime defined here

error: aborting due to previous error

0 comments on commit 188d8c9

Please sign in to comment.