File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
libsyntax_ext/deriving/generic Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -758,7 +758,7 @@ impl<'a> TraitDef<'a> {
758758
759759fn find_repr_type_name ( diagnostic : & Handler ,
760760 type_attrs : & [ ast:: Attribute ] ) -> & ' static str {
761- let mut repr_type_name = "i32 " ;
761+ let mut repr_type_name = "isize " ;
762762 for a in type_attrs {
763763 for r in & attr:: find_repr_attrs ( diagnostic, a) {
764764 repr_type_name = match * r {
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ enum Ei64 {
4747 Bi64 = 0x8000_0000
4848}
4949
50+ #[ derive( PartialEq ) ]
51+ enum Eu64 {
52+ Au64 = 0 ,
53+ Bu64 = 0x8000_0000_0000_0000
54+ }
55+
5056pub fn main ( ) {
5157 assert_eq ! ( size_of:: <Ei8 >( ) , 1 ) ;
5258 assert_eq ! ( size_of:: <Eu8 >( ) , 1 ) ;
@@ -58,4 +64,8 @@ pub fn main() {
5864 assert_eq ! ( size_of:: <Ei64 >( ) , 8 ) ;
5965 #[ cfg( target_pointer_width = "32" ) ]
6066 assert_eq ! ( size_of:: <Ei64 >( ) , 4 ) ;
67+ assert_eq ! ( size_of:: <Eu64 >( ) , 8 ) ;
68+
69+ // ensure no i32 collisions
70+ assert ! ( Eu64 :: Au64 != Eu64 :: Bu64 ) ;
6171}
You can’t perform that action at this time.
0 commit comments