Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jun 3, 2024
1 parent c9e50ae commit 0d88bf2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/ui/inline-const/const_block_pat_liveness.rs
Original file line number Diff line number Diff line change
@@ -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
}
| _ => {}
}
}

0 comments on commit 0d88bf2

Please sign in to comment.