diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-03 09:39:26 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-07 08:33:58 +0000 |
| commit | bbcd8794d03e4061a061a199a6c3c47dc65054c3 (patch) | |
| tree | ae287b3570bcd28af084931bef433ae2f609f009 | |
| parent | cbee17d5025c7824828c793ac776ad6e1addbeac (diff) | |
| download | rust-bbcd8794d03e4061a061a199a6c3c47dc65054c3.tar.gz rust-bbcd8794d03e4061a061a199a6c3c47dc65054c3.zip | |
Add regression test
| -rw-r--r-- | tests/ui/inline-const/const_block_pat_liveness.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/inline-const/const_block_pat_liveness.rs b/tests/ui/inline-const/const_block_pat_liveness.rs new file mode 100644 index 00000000000..26393a4f65b --- /dev/null +++ b/tests/ui/inline-const/const_block_pat_liveness.rs @@ -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 + } + | _ => {} + } +} |
