-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't consider candidates with no failing where clauses when refining obligation causes in new solver #124771
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
let candidates = goal.candidates(); | ||
if candidates.len() > 1 { | ||
candidates.retain(|candidate| { | ||
goal.infcx().probe(|_| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of a shame we have to do this in a probe, but if we don't, then the instantiated nested goals from different candidates will affect eachother, causing weirdness and ICEs.
Luckily, we do this only when there's >1 candidate.
We could, perhaps, first filter out candidates with no GoalSource::ImplWhereBound | GoalSource::InstantiateHigherRanked
without even instantiating them, and only instantiate them if necessary.
Also, I guess we should have both the source and the certainty in the proof tree without instantiating -- we just need to expose it, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this into a separate function fn non_trivial_candidates
or sth 🤔 r=me after that
014ae81
to
4e3350d
Compare
@bors r=lcnr |
… r=lcnr Don't consider candidates with no failing where clauses when refining obligation causes in new solver Improves error messages when we have param-env candidates that don't deeply unify (i.e. after alias-bounds). r? lcnr
💔 Test failed - checks-actions |
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#124520 (Document that `create_dir_all` calls `mkdir`/`CreateDirW` multiple times) - rust-lang#124724 (Prefer lower vtable candidates in select in new solver) - rust-lang#124771 (Don't consider candidates with no failing where clauses when refining obligation causes in new solver) - rust-lang#124808 (Use `super_fold` in `RegionsToStatic` visitor) r? `@ghost` `@rustbot` modify labels: rollup
@bors retry |
Rollup merge of rust-lang#124771 - compiler-errors:cand-has-failing-wc, r=lcnr Don't consider candidates with no failing where clauses when refining obligation causes in new solver Improves error messages when we have param-env candidates that don't deeply unify (i.e. after alias-bounds). r? lcnr
Improves error messages when we have param-env candidates that don't deeply unify (i.e. after alias-bounds).
r? lcnr