File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
compiler/rustc_next_trait_solver/src/solve/eval_ctxt Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -633,28 +633,19 @@ where
633633 // the certainty of all the goals.
634634 #[ instrument( level = "trace" , skip( self ) ) ]
635635 pub ( super ) fn try_evaluate_added_goals ( & mut self ) -> Result < Certainty , NoSolution > {
636- let mut response = Ok ( Certainty :: overflow ( false ) ) ;
637636 for _ in 0 ..FIXPOINT_STEP_LIMIT {
638- // FIXME: This match is a bit ugly, it might be nice to change the inspect
639- // stuff to use a closure instead. which should hopefully simplify this a bit.
640637 match self . evaluate_added_goals_step ( ) {
641- Ok ( Some ( cert) ) => {
642- response = Ok ( cert) ;
643- break ;
644- }
645638 Ok ( None ) => { }
639+ Ok ( Some ( cert) ) => return Ok ( cert) ,
646640 Err ( NoSolution ) => {
647- response = Err ( NoSolution ) ;
648- break ;
641+ self . tainted = Err ( NoSolution ) ;
642+ return Err ( NoSolution ) ;
649643 }
650644 }
651645 }
652646
653- if response. is_err ( ) {
654- self . tainted = Err ( NoSolution ) ;
655- }
656-
657- response
647+ debug ! ( "try_evaluate_added_goals: encountered overflow" ) ;
648+ Ok ( Certainty :: overflow ( false ) )
658649 }
659650
660651 /// Iterate over all added goals: returning `Ok(Some(_))` in case we can stop rerunning.
You can’t perform that action at this time.
0 commit comments