]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ice-packed.rs
Rollup merge of #69974 - GuillaumeGomez:cleanup-e0434, r=Dylan-DPC
[rust.git] / src / test / ui / consts / const-eval / ice-packed.rs
1 // Regression test for #50356: Compiler panic when using repr(packed)
2 // associated constant in a match arm
3
4 // check-pass
5 #[derive(Copy, Clone, PartialEq, Eq)]
6 #[repr(packed)]
7 pub struct Num(u64);
8
9 impl Num {
10     pub const ZERO: Self = Num(0);
11 }
12
13 pub fn decrement(a: Num) -> Num {
14     match a {
15         Num::ZERO => Num::ZERO,
16         a => Num(a.0 - 1)
17     }
18 }
19
20 fn main() {
21 }