File tree 1 file changed +10
-3
lines changed
compiler/rustc_trait_selection/src/solve/assembly
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -312,11 +312,18 @@ 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. It seems to be necessary for typenum but
320
+ // is incredibly hard to minimize as it may rely on being inside of a
321
+ // trait solver cycle.
322
+ let result = self . evaluate_added_goals_and_make_canonical_response ( certainty) ;
316
323
let mut dummy_probe = self . inspect . new_probe ( ) ;
317
- dummy_probe. probe_kind ( ProbeKind :: TraitCandidate { source, result : Ok ( result ) } ) ;
324
+ dummy_probe. probe_kind ( ProbeKind :: TraitCandidate { source, result } ) ;
318
325
self . inspect . finish_probe ( dummy_probe) ;
319
- vec ! [ Candidate { source, result } ]
326
+ if let Ok ( result ) = result { vec ! [ Candidate { source, result } ] } else { vec ! [ ] }
320
327
}
321
328
322
329
#[ instrument( level = "debug" , skip_all) ]
You can’t perform that action at this time.
0 commit comments