]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-derive.rs
Merge commit '23d11428de3e973b34a5090a78d62887f821c90e' into clippyup
[rust.git] / src / test / ui / union / union-derive.rs
1 // Most traits cannot be derived for unions.
2
3 #[derive(
4     PartialEq, //~ ERROR this trait cannot be derived for unions
5     PartialOrd, //~ ERROR this trait cannot be derived for unions
6     Ord, //~ ERROR this trait cannot be derived for unions
7     Hash, //~ ERROR this trait cannot be derived for unions
8     Default, //~ ERROR this trait cannot be derived for unions
9     Debug, //~ ERROR this trait cannot be derived for unions
10 )]
11 union U {
12     a: u8,
13     b: u16,
14 }
15
16 fn main() {}