@@ -321,7 +321,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
321321 //
322322 // No suggestion for: `isize`, `usize`.
323323 fn get_type_suggestion < ' a > (
324- t : & ty :: TyKind < ' _ > ,
324+ t : Ty < ' _ > ,
325325 val : u128 ,
326326 negative : bool ,
327327 ) -> Option < String > {
@@ -347,14 +347,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
347347 }
348348 }
349349 }
350- match t {
351- & ty:: Int ( i) => find_fit ! ( i, val, negative,
350+ match t. sty {
351+ ty:: Int ( i) => find_fit ! ( i, val, negative,
352352 I8 => [ U8 ] => [ I16 , I32 , I64 , I128 ] ,
353353 I16 => [ U16 ] => [ I32 , I64 , I128 ] ,
354354 I32 => [ U32 ] => [ I64 , I128 ] ,
355355 I64 => [ U64 ] => [ I128 ] ,
356356 I128 => [ U128 ] => [ ] ) ,
357- & ty:: Uint ( u) => find_fit ! ( u, val, negative,
357+ ty:: Uint ( u) => find_fit ! ( u, val, negative,
358358 U8 => [ U8 , U16 , U32 , U64 , U128 ] => [ ] ,
359359 U16 => [ U16 , U32 , U64 , U128 ] => [ ] ,
360360 U32 => [ U32 , U64 , U128 ] => [ ] ,
@@ -364,6 +364,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
364364 }
365365 }
366366
367+ #[ cfg_attr( not( stage0) , allow( usage_of_ty_tykind) ) ]
367368 fn report_bin_hex_error (
368369 cx : & LateContext < ' _ , ' _ > ,
369370 expr : & hir:: Expr ,
@@ -398,7 +399,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeLimits {
398399 repr_str, val, t, actually, t
399400 ) ) ;
400401 if let Some ( sugg_ty) =
401- get_type_suggestion ( & cx. tables . node_type ( expr. hir_id ) . sty , val, negative)
402+ get_type_suggestion ( & cx. tables . node_type ( expr. hir_id ) , val, negative)
402403 {
403404 if let Some ( pos) = repr_str. chars ( ) . position ( |c| c == 'i' || c == 'u' ) {
404405 let ( sans_suffix, _) = repr_str. split_at ( pos) ;
0 commit comments