]> git.lizzy.rs Git - rust.git/blob - tests/ui/union/union-derive.rs
Auto merge of #106711 - albertlarsan68:use-ci-llvm-when-lld, r=jyn514
[rust.git] / tests / 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() {}