@@ -519,7 +519,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
519
519
indices : FxHashMap :: default ( ) ,
520
520
binder_index : ty:: INNERMOST ,
521
521
} ;
522
- let out_value = value. fold_with ( & mut canonicalizer) ;
522
+ let out_value = value. fold_with ( & mut canonicalizer) . into_ok ( ) ;
523
523
524
524
// Once we have canonicalized `out_value`, it should not
525
525
// contain anything that ties it to this inference context
@@ -637,7 +637,7 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
637
637
let infcx = self . infcx . expect ( "encountered ty-var without infcx" ) ;
638
638
let bound_to = infcx. shallow_resolve ( ty_var) ;
639
639
if bound_to != ty_var {
640
- self . fold_ty ( bound_to)
640
+ self . fold_ty ( bound_to) . into_ok ( )
641
641
} else {
642
642
let var = self . canonical_var ( info, ty_var. into ( ) ) ;
643
643
self . tcx ( ) . mk_ty ( ty:: Bound ( self . binder_index , var. into ( ) ) )
@@ -656,12 +656,12 @@ impl<'cx, 'tcx> Canonicalizer<'cx, 'tcx> {
656
656
let infcx = self . infcx . expect ( "encountered const-var without infcx" ) ;
657
657
let bound_to = infcx. shallow_resolve ( const_var) ;
658
658
if bound_to != const_var {
659
- self . fold_const ( bound_to)
659
+ self . fold_const ( bound_to) . into_ok ( )
660
660
} else {
661
661
let var = self . canonical_var ( info, const_var. into ( ) ) ;
662
662
self . tcx ( ) . mk_const ( ty:: Const {
663
663
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 ( ) ,
665
665
} )
666
666
}
667
667
}
0 commit comments