diff options
Diffstat (limited to 'tests/ui/repr/packed-struct-with-enum-53728.rs')
| -rw-r--r-- | tests/ui/repr/packed-struct-with-enum-53728.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/repr/packed-struct-with-enum-53728.rs b/tests/ui/repr/packed-struct-with-enum-53728.rs new file mode 100644 index 00000000000..6ce65ed634f --- /dev/null +++ b/tests/ui/repr/packed-struct-with-enum-53728.rs @@ -0,0 +1,20 @@ +// https://github.com/rust-lang/rust/issues/53728 +//@ run-pass + +#![allow(dead_code)] +#[repr(u16)] +enum DeviceKind { + Nil = 0, +} + +#[repr(packed)] +struct DeviceInfo { + endianness: u8, + device_kind: DeviceKind, +} + +fn main() { + let _x = None::<(DeviceInfo, u8)>; + let _y = None::<(DeviceInfo, u16)>; + let _z = None::<(DeviceInfo, u64)>; +} |
