Add a union to the deriving-all-codegen.rs
test.
Because `derive(Clone)` on unions triggers special behaviour.
This commit is contained in:
parent
d46c728bcd
commit
9d38c45a11
2 changed files with 26 additions and 0 deletions
|
@ -66,3 +66,11 @@ enum Fielded {
|
|||
Y(bool),
|
||||
Z(Option<i32>),
|
||||
}
|
||||
|
||||
// A union. Most builtin traits are not derivable for unions.
|
||||
#[derive(Clone, Copy)]
|
||||
pub union Union {
|
||||
pub b: bool,
|
||||
pub u: u32,
|
||||
pub i: i32,
|
||||
}
|
||||
|
|
|
@ -1020,3 +1020,21 @@ impl ::core::cmp::Ord for Fielded {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A union. Most builtin traits are not derivable for unions.
|
||||
pub union Union {
|
||||
pub b: bool,
|
||||
pub u: u32,
|
||||
pub i: i32,
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[allow(unused_qualifications)]
|
||||
impl ::core::clone::Clone for Union {
|
||||
#[inline]
|
||||
fn clone(&self) -> Union {
|
||||
{ let _: ::core::clone::AssertParamIsCopy<Self>; *self }
|
||||
}
|
||||
}
|
||||
#[automatically_derived]
|
||||
#[allow(unused_qualifications)]
|
||||
impl ::core::marker::Copy for Union { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue