@@ -701,14 +701,12 @@ pub fn integer_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) ->
701
701
if let Some ( suf) = suffix {
702
702
if suf. is_empty ( ) { sd. span_bug ( sp, "found empty literal suffix in Some" ) }
703
703
ty = match suf {
704
- "i" => ast:: SignedIntLit ( ast:: TyIs ( true ) , ast:: Plus ) ,
705
- "is" => ast:: SignedIntLit ( ast:: TyIs ( false ) , ast:: Plus ) ,
704
+ "isize" => ast:: SignedIntLit ( ast:: TyIs ( false ) , ast:: Plus ) ,
706
705
"i8" => ast:: SignedIntLit ( ast:: TyI8 , ast:: Plus ) ,
707
706
"i16" => ast:: SignedIntLit ( ast:: TyI16 , ast:: Plus ) ,
708
707
"i32" => ast:: SignedIntLit ( ast:: TyI32 , ast:: Plus ) ,
709
708
"i64" => ast:: SignedIntLit ( ast:: TyI64 , ast:: Plus ) ,
710
- "u" => ast:: UnsignedIntLit ( ast:: TyUs ( true ) ) ,
711
- "us" => ast:: UnsignedIntLit ( ast:: TyUs ( false ) ) ,
709
+ "usize" => ast:: UnsignedIntLit ( ast:: TyUs ( false ) ) ,
712
710
"u8" => ast:: UnsignedIntLit ( ast:: TyU8 ) ,
713
711
"u16" => ast:: UnsignedIntLit ( ast:: TyU16 ) ,
714
712
"u32" => ast:: UnsignedIntLit ( ast:: TyU32 ) ,
@@ -722,6 +720,17 @@ pub fn integer_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) ->
722
720
& suf[ 1 ..] ) ) ;
723
721
} else {
724
722
sd. span_err ( sp, & * format ! ( "illegal suffix `{}` for numeric literal" , suf) ) ;
723
+
724
+ if suf == "i" || suf == "is" {
725
+ sd. span_help ( sp, "per RFC 544/573, the suffix \
726
+ for `isize` literals is now `isize`") ;
727
+ } else if suf == "u" || suf == "us" {
728
+ sd. span_help ( sp, "per RFC 544/573, the suffix \
729
+ for `usize` literals is now `usize`") ;
730
+ } else {
731
+ sd. span_help ( sp, "the suffix must be one of the integral types \
732
+ (`u32`, `isize`, etc)") ;
733
+ }
725
734
}
726
735
727
736
ty
0 commit comments