diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/consts/const-enum-tuplestruct.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-enum-tuplestruct.rs b/src/test/ui/consts/const-enum-tuplestruct.rs new file mode 100644 index 000000000..f93945c6a --- /dev/null +++ b/src/test/ui/consts/const-enum-tuplestruct.rs @@ -0,0 +1,12 @@ +// run-pass +#![allow(dead_code)] + +enum E { V16(u16), V32(u32) } +struct S(E, u16, u16); +static C: S = S(E::V16(0xDEAD), 0x600D, 0xBAD); + +pub fn main() { + let S(_, n, _) = C; + assert!(n != 0xBAD); + assert_eq!(n, 0x600D); +} |