rust/tests/ui/consts/packed_pattern.rs
2024-02-16 20:02:50 +00:00

19 lines
340 B
Rust

//@ run-pass
#[derive(PartialEq, Eq, Copy, Clone)]
#[repr(packed)]
struct Foo {
field: (i64, u32, u32, u32),
}
const FOO: Foo = Foo {
field: (5, 6, 7, 8),
};
fn main() {
match FOO {
Foo { field: (5, 6, 7, 8) } => {},
FOO => unreachable!(), //~ WARNING unreachable pattern
_ => unreachable!(),
}
}