@@ -166,7 +166,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
166
166
use rustc_middle:: ty:: TypeAndMut ;
167
167
use rustc_middle:: ty:: { AdtDef , Binder , ExistentialProjection , ExistentialTraitRef } ;
168
168
169
- let Ok ( result) = orig. fold_with ( & mut BottomUpFolder {
169
+ let result = orig. fold_with ( & mut BottomUpFolder {
170
170
tcx : self . tcx ,
171
171
ty_op : |ty| {
172
172
match * ty. kind ( ) {
@@ -559,12 +559,12 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
559
559
self . infcx . tcx
560
560
}
561
561
562
- fn fold_ty ( & mut self , ty : Ty < ' tcx > ) -> Result < Ty < ' tcx > , Self :: Error > {
562
+ fn fold_ty ( & mut self , ty : Ty < ' tcx > ) -> Ty < ' tcx > {
563
563
use rustc_middle:: ty:: TyKind ;
564
564
use rustc_middle:: ty:: TypeAndMut ;
565
565
566
- let t1 = ty. super_fold_with ( self ) ? ;
567
- Ok ( match * t1. kind ( ) {
566
+ let t1 = ty. super_fold_with ( self ) ;
567
+ match * t1. kind ( ) {
568
568
TyKind :: Ref ( region, ty, mutbl) if region. needs_infer ( ) => {
569
569
let ty_and_mut = TypeAndMut { ty, mutbl } ;
570
570
self . infcx
@@ -573,15 +573,15 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
573
573
}
574
574
TyKind :: Infer ( _) => self . infcx . tcx . ty_error ( ) ,
575
575
_ => t1,
576
- } )
576
+ }
577
577
}
578
578
579
- fn fold_region ( & mut self , r : Region < ' tcx > ) -> Result < Region < ' tcx > , Self :: Error > {
580
- let r1 = r. super_fold_with ( self ) ? ;
581
- Ok ( if r1. needs_infer ( ) {
579
+ fn fold_region ( & mut self , r : Region < ' tcx > ) -> Region < ' tcx > {
580
+ let r1 = r. super_fold_with ( self ) ;
581
+ if r1. needs_infer ( ) {
582
582
self . infcx . tcx . lifetimes . re_erased
583
583
} else {
584
584
r1
585
- } )
585
+ }
586
586
}
587
587
}
0 commit comments