This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
compiler/rustc_trait_selection/src/solve/assembly Expand file tree Collapse file tree 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> {
312312 fn forced_ambiguity ( & mut self , cause : MaybeCause ) -> Vec < Candidate < ' tcx > > {
313313 let source = CandidateSource :: BuiltinImpl ( BuiltinImplSource :: Misc ) ;
314314 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) ;
316323 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 } ) ;
318325 self . inspect . finish_probe ( dummy_probe) ;
319- vec ! [ Candidate { source, result } ]
326+ if let Ok ( result ) = result { vec ! [ Candidate { source, result } ] } else { vec ! [ ] }
320327 }
321328
322329 #[ instrument( level = "debug" , skip_all) ]
You can’t perform that action at this time.
0 commit comments