Don't ICE because recomputing overflow goals during find_best_leaf_obligation causes inference side-effects#124871
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
lcnr
left a comment
There was a problem hiding this comment.
I just realized: BestObligation<'tcx>::visit_goal always returns ControlFLow::Break, doesn't it? This means that in the for nested_goals loops, we always just use the first nested ImplWhereBound of the loop 🤔 this is surprising and means the impl_where_bound_count is actually unused?
| candidates.retain(|candidate| candidate.result().is_ok()); | ||
| } | ||
| false => { | ||
| candidates.retain(|candidate| candidate.result().is_err()); |
There was a problem hiding this comment.
this retain feels off: I would expecct us to never fail if there are any non-err candidates 🤔
There was a problem hiding this comment.
Yeah, it's probably useless.
There was a problem hiding this comment.
pls remove it or change it to an assert then 🤔
Not if we have an ambig impl where bound then an err impl where bound. |
…ligation causes inference side-effects
d3f570b to
d3e510e
Compare
|
@bors r=lcnr rollup |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#124871 (Don't ICE because recomputing overflow goals during find_best_leaf_obligation causes inference side-effects) - rust-lang#125018 (Update linker-plugin-lto.md to include LLVM 18) - rust-lang#125130 (rustdoc-json-types: Document `Id`) - rust-lang#125170 (Uplift `FnSig` into `rustc_type_ir` (redux)) - rust-lang#125172 (Fix assertion when attempting to convert `f16` and `f128` with `as`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124871 - compiler-errors:overflowo, r=lcnr Don't ICE because recomputing overflow goals during find_best_leaf_obligation causes inference side-effects See the comments for more info. Reprocessing overflowed obligations may cause *other* goals to go from ambig -> pass/fail, causing an ICE. This suppresses that error, but makes all the overflow obligations messages back to their root obl. That kinda sucks, but 🤷 Fixes rust-lang#124834 Fixes rust-lang#124845 r? lcnr
See the comments for more info. Reprocessing overflowed obligations may cause other goals to go from ambig -> pass/fail, causing an ICE. This suppresses that error, but makes all the overflow obligations messages back to their root obl. That kinda sucks, but 🤷
Fixes #124834
Fixes #124845
r? lcnr