File tree 2 files changed +11
-1
lines changed
libsyntax_ext/deriving/generic
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> {
758
758
759
759
fn find_repr_type_name ( diagnostic : & Handler ,
760
760
type_attrs : & [ ast:: Attribute ] ) -> & ' static str {
761
- let mut repr_type_name = "i32 " ;
761
+ let mut repr_type_name = "isize " ;
762
762
for a in type_attrs {
763
763
for r in & attr:: find_repr_attrs ( diagnostic, a) {
764
764
repr_type_name = match * r {
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ enum Ei64 {
47
47
Bi64 = 0x8000_0000
48
48
}
49
49
50
+ #[ derive( PartialEq ) ]
51
+ enum Eu64 {
52
+ Au64 = 0 ,
53
+ Bu64 = 0x8000_0000_0000_0000
54
+ }
55
+
50
56
pub fn main ( ) {
51
57
assert_eq ! ( size_of:: <Ei8 >( ) , 1 ) ;
52
58
assert_eq ! ( size_of:: <Eu8 >( ) , 1 ) ;
@@ -58,4 +64,8 @@ pub fn main() {
58
64
assert_eq ! ( size_of:: <Ei64 >( ) , 8 ) ;
59
65
#[ cfg( target_pointer_width = "32" ) ]
60
66
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 ) ;
61
71
}
You can’t perform that action at this time.
0 commit comments