File tree 1 file changed +8
-3
lines changed
compiler/rustc_trait_selection/src/solve/assembly
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -312,11 +312,16 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
312
312
fn forced_ambiguity ( & mut self , cause : MaybeCause ) -> Vec < Candidate < ' tcx > > {
313
313
let source = CandidateSource :: BuiltinImpl ( BuiltinImplSource :: Misc ) ;
314
314
let certainty = Certainty :: Maybe ( cause) ;
315
- let result = self . evaluate_added_goals_and_make_canonical_response ( certainty) . unwrap ( ) ;
315
+ // This may fail if `try_evaluate_added_goals` overflows because it
316
+ // fails to reach a fixpoint but ends up getting an error after
317
+ // running for some additional step.
318
+ //
319
+ // FIXME: Add a test for this.
320
+ let result = self . evaluate_added_goals_and_make_canonical_response ( certainty) ;
316
321
let mut dummy_probe = self . inspect . new_probe ( ) ;
317
- dummy_probe. probe_kind ( ProbeKind :: TraitCandidate { source, result : Ok ( result ) } ) ;
322
+ dummy_probe. probe_kind ( ProbeKind :: TraitCandidate { source, result } ) ;
318
323
self . inspect . finish_probe ( dummy_probe) ;
319
- vec ! [ Candidate { source, result } ]
324
+ if let Ok ( result ) = result { vec ! [ Candidate { source, result } ] } else { vec ! [ ] }
320
325
}
321
326
322
327
#[ instrument( level = "debug" , skip_all) ]
You can’t perform that action at this time.
0 commit comments