]> git.lizzy.rs Git - rust.git/blob - src/test/ui/repr/repr-no-niche-inapplicable-to-unions.rs
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / ui / repr / repr-no-niche-inapplicable-to-unions.rs
1 #![feature(no_niche)]
2
3 use std::num::NonZeroU8 as N8;
4 use std::num::NonZeroU16 as N16;
5
6 #[repr(no_niche)]
7 pub union Cloaked1 { _A: N16 }
8 //~^^ ERROR attribute should be applied to a struct or enum [E0517]
9
10 #[repr(no_niche)]
11 pub union Cloaked2 { _A: N16, _B: (u8, N8) }
12 //~^^ ERROR attribute should be applied to a struct or enum [E0517]
13
14 fn main() { }