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

Allow multiple candidates with same response in new solver #107863

Merged

Conversation

compiler-errors
Copy link
Member

Treat >1 candidates as not ambiguous if they return the same response.

@rustbot
Copy link
Collaborator

rustbot commented Feb 10, 2023

r? @Nilstrieb

(rustbot has picked a reviewer for you, use r? to override)

@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 labels Feb 10, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 10, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

Some changes occurred to the core trait solver

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

@compiler-errors
Copy link
Member Author

r? @lcnr

if candidates.len() > 1 {
// If there are *STILL* multiple candidates that have *different* response
// results, give up and report ambiguity.
if candidates.len() > 1 && !candidates.iter().map(|cand| cand.result).all_equal() {
Copy link
Member Author

@compiler-errors compiler-errors Feb 10, 2023

Choose a reason for hiding this comment

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

I guess we could also take the intersection of the candidates' certainty... but if they're not all Certainty::Yes then we already return ambiguous, so I think this has the same effect.

@jackh726
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 10, 2023

📌 Commit 3c4e1f8 has been approved by jackh726

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 Feb 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#107043 (Support `true` and `false` as boolean flag params)
 - rust-lang#107831 (Query refactoring)
 - rust-lang#107841 (Handled snap curl issue inside Rust)
 - rust-lang#107852 (rustdoc: remove unused fn parameter `tab`)
 - rust-lang#107861 (Sync release notes for 1.67.1)
 - rust-lang#107863 (Allow multiple candidates with same response in new solver)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@lcnr
Copy link
Contributor

lcnr commented Feb 10, 2023

@bors rollup

@bors bors merged commit 9300617 into rust-lang:master Feb 10, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 10, 2023
@compiler-errors compiler-errors deleted the new-solver-multiple-candidates branch August 11, 2023 20:09
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants