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
633
633
// the certainty of all the goals.
634
634
#[ instrument( level = "trace" , skip( self ) ) ]
635
635
pub ( super ) fn try_evaluate_added_goals ( & mut self ) -> Result < Certainty , NoSolution > {
636
- let mut response = Ok ( Certainty :: overflow ( false ) ) ;
637
636
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.
640
637
match self . evaluate_added_goals_step ( ) {
641
- Ok ( Some ( cert) ) => {
642
- response = Ok ( cert) ;
643
- break ;
644
- }
645
638
Ok ( None ) => { }
639
+ Ok ( Some ( cert) ) => return Ok ( cert) ,
646
640
Err ( NoSolution ) => {
647
- response = Err ( NoSolution ) ;
648
- break ;
641
+ self . tainted = Err ( NoSolution ) ;
642
+ return Err ( NoSolution ) ;
649
643
}
650
644
}
651
645
}
652
646
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 ) )
658
649
}
659
650
660
651
/// 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