]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-derive.rs
Rollup merge of #93926 - PatchMixolydic:bugfix/must_use-on-exprs, r=cjgillot
[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() {}