@@ -100,10 +100,7 @@ use rustc_middle::mir::ConstantKind;
100100use rustc_middle:: ty as rustc_ty;
101101use rustc_middle:: ty:: adjustment:: { Adjust , Adjustment , AutoBorrow } ;
102102use rustc_middle:: ty:: binding:: BindingMode ;
103- use rustc_middle:: ty:: fast_reject:: SimplifiedType :: {
104- ArraySimplifiedType , BoolSimplifiedType , CharSimplifiedType , FloatSimplifiedType , IntSimplifiedType ,
105- PtrSimplifiedType , SliceSimplifiedType , StrSimplifiedType , UintSimplifiedType ,
106- } ;
103+ use rustc_middle:: ty:: fast_reject:: SimplifiedType ;
107104use rustc_middle:: ty:: layout:: IntegerExt ;
108105use rustc_middle:: ty:: {
109106 BorrowKind , ClosureKind , FloatTy , IntTy , Ty , TyCtxt , TypeAndMut , TypeVisitableExt , UintTy , UpvarCapture ,
@@ -512,30 +509,30 @@ pub fn path_def_id<'tcx>(cx: &LateContext<'_>, maybe_path: &impl MaybePath<'tcx>
512509
513510fn find_primitive_impls < ' tcx > ( tcx : TyCtxt < ' tcx > , name : & str ) -> impl Iterator < Item = DefId > + ' tcx {
514511 let ty = match name {
515- "bool" => BoolSimplifiedType ,
516- "char" => CharSimplifiedType ,
517- "str" => StrSimplifiedType ,
518- "array" => ArraySimplifiedType ,
519- "slice" => SliceSimplifiedType ,
512+ "bool" => SimplifiedType :: Bool ,
513+ "char" => SimplifiedType :: Char ,
514+ "str" => SimplifiedType :: Str ,
515+ "array" => SimplifiedType :: Array ,
516+ "slice" => SimplifiedType :: Slice ,
520517 // FIXME: rustdoc documents these two using just `pointer`.
521518 //
522519 // Maybe this is something we should do here too.
523- "const_ptr" => PtrSimplifiedType ( Mutability :: Not ) ,
524- "mut_ptr" => PtrSimplifiedType ( Mutability :: Mut ) ,
525- "isize" => IntSimplifiedType ( IntTy :: Isize ) ,
526- "i8" => IntSimplifiedType ( IntTy :: I8 ) ,
527- "i16" => IntSimplifiedType ( IntTy :: I16 ) ,
528- "i32" => IntSimplifiedType ( IntTy :: I32 ) ,
529- "i64" => IntSimplifiedType ( IntTy :: I64 ) ,
530- "i128" => IntSimplifiedType ( IntTy :: I128 ) ,
531- "usize" => UintSimplifiedType ( UintTy :: Usize ) ,
532- "u8" => UintSimplifiedType ( UintTy :: U8 ) ,
533- "u16" => UintSimplifiedType ( UintTy :: U16 ) ,
534- "u32" => UintSimplifiedType ( UintTy :: U32 ) ,
535- "u64" => UintSimplifiedType ( UintTy :: U64 ) ,
536- "u128" => UintSimplifiedType ( UintTy :: U128 ) ,
537- "f32" => FloatSimplifiedType ( FloatTy :: F32 ) ,
538- "f64" => FloatSimplifiedType ( FloatTy :: F64 ) ,
520+ "const_ptr" => SimplifiedType :: Ptr ( Mutability :: Not ) ,
521+ "mut_ptr" => SimplifiedType :: Ptr ( Mutability :: Mut ) ,
522+ "isize" => SimplifiedType :: Int ( IntTy :: Isize ) ,
523+ "i8" => SimplifiedType :: Int ( IntTy :: I8 ) ,
524+ "i16" => SimplifiedType :: Int ( IntTy :: I16 ) ,
525+ "i32" => SimplifiedType :: Int ( IntTy :: I32 ) ,
526+ "i64" => SimplifiedType :: Int ( IntTy :: I64 ) ,
527+ "i128" => SimplifiedType :: Int ( IntTy :: I128 ) ,
528+ "usize" => SimplifiedType :: Uint ( UintTy :: Usize ) ,
529+ "u8" => SimplifiedType :: Uint ( UintTy :: U8 ) ,
530+ "u16" => SimplifiedType :: Uint ( UintTy :: U16 ) ,
531+ "u32" => SimplifiedType :: Uint ( UintTy :: U32 ) ,
532+ "u64" => SimplifiedType :: Uint ( UintTy :: U64 ) ,
533+ "u128" => SimplifiedType :: Uint ( UintTy :: U128 ) ,
534+ "f32" => SimplifiedType :: Float ( FloatTy :: F32 ) ,
535+ "f64" => SimplifiedType :: Float ( FloatTy :: F64 ) ,
539536 _ => return [ ] . iter ( ) . copied ( ) ,
540537 } ;
541538
0 commit comments