@@ -485,35 +485,38 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
485485 mut goals : Vec < Goal < ' tcx , ty:: Predicate < ' tcx > > > ,
486486 ) -> Result < Certainty , NoSolution > {
487487 let mut new_goals = Vec :: new ( ) ;
488- self . repeat_while_none ( |this| {
489- let mut has_changed = Err ( Certainty :: Yes ) ;
490- for goal in goals. drain ( ..) {
491- let ( changed, certainty) = match this. evaluate_goal ( goal) {
492- Ok ( result) => result,
493- Err ( NoSolution ) => return Some ( Err ( NoSolution ) ) ,
494- } ;
495-
496- if changed {
497- has_changed = Ok ( ( ) ) ;
498- }
488+ self . repeat_while_none (
489+ |_| Certainty :: Maybe ( MaybeCause :: Overflow ) ,
490+ |this| {
491+ let mut has_changed = Err ( Certainty :: Yes ) ;
492+ for goal in goals. drain ( ..) {
493+ let ( changed, certainty) = match this. evaluate_goal ( goal) {
494+ Ok ( result) => result,
495+ Err ( NoSolution ) => return Some ( Err ( NoSolution ) ) ,
496+ } ;
497+
498+ if changed {
499+ has_changed = Ok ( ( ) ) ;
500+ }
499501
500- match certainty {
501- Certainty :: Yes => { }
502- Certainty :: Maybe ( _) => {
503- new_goals. push ( goal) ;
504- has_changed = has_changed. map_err ( |c| c. unify_and ( certainty) ) ;
502+ match certainty {
503+ Certainty :: Yes => { }
504+ Certainty :: Maybe ( _) => {
505+ new_goals. push ( goal) ;
506+ has_changed = has_changed. map_err ( |c| c. unify_and ( certainty) ) ;
507+ }
505508 }
506509 }
507- }
508510
509- match has_changed {
510- Ok ( ( ) ) => {
511- mem:: swap ( & mut new_goals, & mut goals) ;
512- None
511+ match has_changed {
512+ Ok ( ( ) ) => {
513+ mem:: swap ( & mut new_goals, & mut goals) ;
514+ None
515+ }
516+ Err ( certainty) => Some ( Ok ( certainty) ) ,
513517 }
514- Err ( certainty) => Some ( Ok ( certainty) ) ,
515- }
516- } )
518+ } ,
519+ )
517520 }
518521
519522 // Recursively evaluates a list of goals to completion, making a query response.
0 commit comments