Skip to content

Commit bbcd879

Browse files
committed
Add regression test
1 parent cbee17d commit bbcd879

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Diff for: tests/ui/inline-const/const_block_pat_liveness.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! This test used to ICE because const blocks didn't have a body
2+
//! anymore, making a lot of logic very fragile around handling the
3+
//! HIR of a const block.
4+
//! https://github.com/rust-lang/rust/issues/125846
5+
6+
//@ check-pass
7+
8+
#![feature(inline_const_pat)]
9+
10+
fn main() {
11+
match 0 {
12+
const {
13+
let a = 10_usize;
14+
*&a
15+
}
16+
| _ => {}
17+
}
18+
}

0 commit comments

Comments
 (0)