Rollup merge of #130273 - lcnr:overflow-no-constraints, r=compiler-errors
more eagerly discard constraints on overflow
We always discard the results of overflowing goals inside of the trait solver. We previously did so when instantiating the response in `evaluate_goal`. Canonicalizing results only to later discard them is also inefficient 🤷
It's simpler and nicer to debug to eagerly discard constraints inside of the query itself.
r? ``@compiler-errors``
This commit is contained in:
commit
cb1d80d1e5
5 changed files with 27 additions and 35 deletions
|
@ -302,7 +302,7 @@ fn fulfillment_error_for_stalled<'tcx>(
|
|||
Ok((_, Certainty::Maybe(MaybeCause::Overflow { suggest_increasing_limit }))) => (
|
||||
FulfillmentErrorCode::Ambiguity { overflow: Some(suggest_increasing_limit) },
|
||||
// Don't look into overflows because we treat overflows weirdly anyways.
|
||||
// In `instantiate_response_discarding_overflow` we set `has_changed = false`,
|
||||
// We discard the inference constraints from overflowing goals, so
|
||||
// recomputing the goal again during `find_best_leaf_obligation` may apply
|
||||
// inference guidance that makes other goals go from ambig -> pass, for example.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue