mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
28 lines
435 B
Rust
28 lines
435 B
Rust
//@ run-pass
|
|
|
|
#[derive(PartialEq, Eq, Copy, Clone)]
|
|
#[repr(packed)]
|
|
struct Foo {
|
|
field: (u8, u16),
|
|
}
|
|
|
|
#[derive(PartialEq, Eq, Copy, Clone)]
|
|
#[repr(align(2))]
|
|
struct Bar {
|
|
a: Foo,
|
|
}
|
|
|
|
const FOO: Bar = Bar {
|
|
a: Foo {
|
|
field: (5, 6),
|
|
}
|
|
};
|
|
|
|
fn main() {
|
|
match FOO {
|
|
Bar { a: Foo { field: (5, 6) } } => {},
|
|
FOO => unreachable!(), //~ WARNING unreachable pattern
|
|
_ => unreachable!(),
|
|
}
|
|
}
|