Add regression test
This commit is contained in:
parent
cbee17d502
commit
bbcd8794d0
18
tests/ui/inline-const/const_block_pat_liveness.rs
Normal file
18
tests/ui/inline-const/const_block_pat_liveness.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//! This test used to ICE because const blocks didn't have a body
|
||||||
|
//! anymore, making a lot of logic very fragile around handling the
|
||||||
|
//! HIR of a const block.
|
||||||
|
//! https://github.com/rust-lang/rust/issues/125846
|
||||||
|
|
||||||
|
//@ check-pass
|
||||||
|
|
||||||
|
#![feature(inline_const_pat)]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
match 0 {
|
||||||
|
const {
|
||||||
|
let a = 10_usize;
|
||||||
|
*&a
|
||||||
|
}
|
||||||
|
| _ => {}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user