Skip to content

Commit

Permalink
Rollup merge of #114524 - compiler-errors:more-ice-in-uncertainty, r=…
Browse files Browse the repository at this point in the history
…jackh726

Also ICE when goals go from Ok to Err in new solver

We were just using `?` here, silently downgrading the goal's response from (presumably) maybe to error -- that seems concerning, since this whole check is for detecting goal instability 😅

r? `@lcnr` or `@BoxyUwU`
  • Loading branch information
matthiaskrgr authored Aug 6, 2023
2 parents e0f04ef + 55bf810 commit bf4b1d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions compiler/rustc_trait_selection/src/solve/eval_ctxt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,19 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
debug!("rerunning goal to check result is stable");
self.search_graph.reset_encountered_overflow(encountered_overflow);
let (_orig_values, canonical_goal) = self.canonicalize_goal(goal);
let new_canonical_response = EvalCtxt::evaluate_canonical_goal(
let Ok(new_canonical_response) = EvalCtxt::evaluate_canonical_goal(
self.tcx(),
self.search_graph,
canonical_goal,
// FIXME(-Ztrait-solver=next): we do not track what happens in `evaluate_canonical_goal`
&mut ProofTreeBuilder::new_noop(),
)?;
) else {
bug!(
"goal went from {certainty:?} to error: re-canonicalized goal={canonical_goal:#?} \
first_response={canonical_response:#?},
second response was error"
);
};
// We only check for modulo regions as we convert all regions in
// the input to new existentials, even if they're expected to be
// `'static` or a placeholder region.
Expand Down

0 comments on commit bf4b1d7

Please sign in to comment.