Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test for fixed ICE #116561

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:11:35
|
LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>,
| -^
| |
| lifetime defined here

error: aborting due to previous error

Loading