File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -66,3 +66,11 @@ enum Fielded {
6666 Y ( bool ) ,
6767 Z ( Option < i32 > ) ,
6868}
69+
70+ // A union. Most builtin traits are not derivable for unions.
71+ #[ derive( Clone , Copy ) ]
72+ pub union Union {
73+ pub b : bool ,
74+ pub u : u32 ,
75+ pub i : i32 ,
76+ }
Original file line number Diff line number Diff line change @@ -1020,3 +1020,21 @@ impl ::core::cmp::Ord for Fielded {
10201020 }
10211021 }
10221022}
1023+
1024+ // A union. Most builtin traits are not derivable for unions.
1025+ pub union Union {
1026+ pub b: bool,
1027+ pub u: u32,
1028+ pub i: i32,
1029+ }
1030+ #[automatically_derived]
1031+ #[allow(unused_qualifications)]
1032+ impl ::core::clone::Clone for Union {
1033+ #[inline]
1034+ fn clone(&self) -> Union {
1035+ { let _: ::core::clone::AssertParamIsCopy<Self>; *self }
1036+ }
1037+ }
1038+ #[automatically_derived]
1039+ #[allow(unused_qualifications)]
1040+ impl ::core::marker::Copy for Union { }
You can’t perform that action at this time.
0 commit comments