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

Prefer lower vtable candidates in select in new solver #124724

Merged
merged 1 commit into from
May 6, 2024

Conversation

compiler-errors
Copy link
Member

Also, adjust the select visitor to only winnow when the parent goal is Certainty::Yes. This means that we won't winnow in cases when we have any ambiguous inference guidance from two candidates.

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 4, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 4, 2024

Some changes occurred to the core trait solver

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

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.

r=me after nits

@@ -85,8 +91,7 @@ fn candidate_should_be_dropped_in_favor_of<'tcx>(
victim: &inspect::InspectCandidate<'_, 'tcx>,
other: &inspect::InspectCandidate<'_, 'tcx>,
) -> bool {
// Don't winnow until `Certainty::Yes` -- we don't need to winnow until
// codegen, technically.
// codegen, technically, and all goals should hold in codegen.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fff

Copy link
Contributor

@lcnr lcnr May 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment doesn't make sense to me 🤔 candidates can overflow in codegen, so there can always be uncertainty

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I mean on the good path. Unless you think we should winnow ambig candidates, or something.

@lcnr
Copy link
Contributor

lcnr commented May 6, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 6, 2024

📌 Commit a4ee20e 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
…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 bors merged commit 2d557ba into rust-lang:master May 6, 2024
6 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#124724 - compiler-errors:prefer-lower, r=lcnr

Prefer lower vtable candidates in select in new solver

Also, adjust the select visitor to only winnow when the *parent* goal is `Certainty::Yes`. This means that we won't winnow in cases when we have any ambiguous inference guidance from two candidates.

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.

4 participants