@@ -519,7 +519,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
519519 indices : FxHashMap :: default ( ) ,
520520 binder_index : ty:: INNERMOST ,
521521 } ;
522- let out_value = value. fold_with ( & mut canonicalizer) ;
522+ let out_value = value. fold_with ( & mut canonicalizer) . into_ok ( ) ;
523523
524524 // Once we have canonicalized `out_value`, it should not
525525 // contain anything that ties it to this inference context
@@ -637,7 +637,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
637637 let infcx = self . infcx . expect ( "encountered ty-var without infcx" ) ;
638638 let bound_to = infcx. shallow_resolve ( ty_var) ;
639639 if bound_to != ty_var {
640- self . fold_ty ( bound_to)
640+ self . fold_ty ( bound_to) . into_ok ( )
641641 } else {
642642 let var = self . canonical_var ( info, ty_var. into ( ) ) ;
643643 self . tcx ( ) . mk_ty ( ty:: Bound ( self . binder_index , var. into ( ) ) )
@@ -656,12 +656,12 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
656656 let infcx = self . infcx . expect ( "encountered const-var without infcx" ) ;
657657 let bound_to = infcx. shallow_resolve ( const_var) ;
658658 if bound_to != const_var {
659- self . fold_const ( bound_to)
659+ self . fold_const ( bound_to) . into_ok ( )
660660 } else {
661661 let var = self . canonical_var ( info, const_var. into ( ) ) ;
662662 self . tcx ( ) . mk_const ( ty:: Const {
663663 val : ty:: ConstKind :: Bound ( self . binder_index , var) ,
664- ty : self . fold_ty ( const_var. ty ) ,
664+ ty : self . fold_ty ( const_var. ty ) . into_ok ( ) ,
665665 } )
666666 }
667667 }
0 commit comments