]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-derive.rs
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-and-pms-component
[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() {}