Skip to content

Commit a42adf2

Browse files
committed
add test for ICE caused by using feature(generic_const_exprs) #114463
Fixes #114463
1 parent 751f662 commit a42adf2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// issue: rust-lang/rust#114463
2+
// ICE cannot convert `ReFree ..` to a region vid
3+
#![feature(generic_const_exprs)]
4+
//~^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
5+
fn bug<'a>() {
6+
[(); (|_: &'a u8| (), 0).1];
7+
//~^ ERROR cannot capture late-bound lifetime in constant
8+
}
9+
10+
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/cannot-convert-refree-ice-114463.rs:3:12
3+
|
4+
LL | #![feature(generic_const_exprs)]
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
10+
error: cannot capture late-bound lifetime in constant
11+
--> $DIR/cannot-convert-refree-ice-114463.rs:6:16
12+
|
13+
LL | fn bug<'a>() {
14+
| -- lifetime defined here
15+
LL | [(); (|_: &'a u8| (), 0).1];
16+
| ^^
17+
18+
error: aborting due to 1 previous error; 1 warning emitted
19+

0 commit comments

Comments
 (0)