Skip to content
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

Merged
merged 1 commit into from
May 6, 2024

Conversation

compiler-errors
Copy link
Member

Improves error messages when we have param-env candidates that don't deeply unify (i.e. after alias-bounds).

r? lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels May 5, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 5, 2024

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@compiler-errors compiler-errors changed the title Don't consider candidates with no failing where clauses Don't consider candidates with no failing where clauses when refining obligation causes in new solver May 5, 2024
let candidates = goal.candidates();
if candidates.len() > 1 {
candidates.retain(|candidate| {
goal.infcx().probe(|_| {
Copy link
Member Author

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?

Copy link
Contributor

@lcnr lcnr left a 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

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented May 6, 2024

📌 Commit 4e3350d has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2024
… 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
@bors
Copy link
Contributor

bors commented May 6, 2024

⌛ Testing commit 4e3350d with merge 5a2bf53...

@rust-log-analyzer
Copy link
Collaborator

The job armhf-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented May 6, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2024
…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
@lcnr
Copy link
Contributor

lcnr commented May 6, 2024

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 6, 2024
@bors bors merged commit 43de822 into rust-lang:master May 6, 2024
6 of 7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 6, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants