2019-06-11 09:17:26 -05:00
|
|
|
// 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) } } => {},
|
2019-11-05 18:00:00 -06:00
|
|
|
FOO => unreachable!(), //~ WARNING unreachable pattern
|
2019-06-11 09:17:26 -05:00
|
|
|
_ => unreachable!(),
|
|
|
|
}
|
|
|
|
}
|