diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 3896a7ce71462..119b88befd1d8 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -757,7 +757,7 @@ impl<'a> TraitDef<'a> { fn find_repr_type_name(diagnostic: &Handler, type_attrs: &[ast::Attribute]) -> &'static str { - let mut repr_type_name = "i32"; + let mut repr_type_name = "i64"; for a in type_attrs { for r in &attr::find_repr_attrs(diagnostic, a) { repr_type_name = match *r { diff --git a/src/test/run-pass/enum-discrim-autosizing.rs b/src/test/run-pass/enum-discrim-autosizing.rs index 99e44735d0f03..f027689a64a54 100644 --- a/src/test/run-pass/enum-discrim-autosizing.rs +++ b/src/test/run-pass/enum-discrim-autosizing.rs @@ -46,6 +46,7 @@ enum Ei64 { Bi64 = 0x8000_0000 } +#[derive(PartialEq)] enum Eu64 { Au64 = 0, Bu64 = 0x8000_0000_0000_0000 @@ -60,4 +61,7 @@ pub fn main() { assert_eq!(size_of::(), 4); assert_eq!(size_of::(), 8); assert_eq!(size_of::(), 8); + + // ensure no i32 collisions + assert!(Eu64::Au64 != Eu64::Bu64); }