@@ -166,7 +166,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
166166 use rustc_middle:: ty:: TypeAndMut ;
167167 use rustc_middle:: ty:: { AdtDef , Binder , ExistentialProjection , ExistentialTraitRef } ;
168168
169- let Ok ( result ) = orig. fold_with ( & mut BottomUpFolder {
169+ orig. fold_with ( & mut BottomUpFolder {
170170 tcx : self . tcx ,
171171 ty_op : |ty| {
172172 match * ty. kind ( ) {
@@ -327,8 +327,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
327327 } ,
328328 lt_op : |region| self . translate_region ( region) ,
329329 ct_op : |konst| konst, // TODO: translate consts
330- } ) ;
331- result
330+ } )
332331 }
333332
334333 /// Translate a region.
@@ -504,6 +503,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
504503 ParamEnv :: new (
505504 self . tcx . intern_predicates ( & target_preds) ,
506505 param_env. reveal ( ) ,
506+ param_env. constness ( ) ,
507507 )
508508 } )
509509 }
@@ -559,12 +559,12 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
559559 self . infcx . tcx
560560 }
561561
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 > {
563563 use rustc_middle:: ty:: TyKind ;
564564 use rustc_middle:: ty:: TypeAndMut ;
565565
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 ( ) {
568568 TyKind :: Ref ( region, ty, mutbl) if region. needs_infer ( ) => {
569569 let ty_and_mut = TypeAndMut { ty, mutbl } ;
570570 self . infcx
@@ -573,15 +573,15 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
573573 }
574574 TyKind :: Infer ( _) => self . infcx . tcx . ty_error ( ) ,
575575 _ => t1,
576- } )
576+ }
577577 }
578578
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 ( ) {
582582 self . infcx . tcx . lifetimes . re_erased
583583 } else {
584584 r1
585- } )
585+ }
586586 }
587587}
0 commit comments