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

Deduplicate ParamCandidates with the same value except for bound vars #84559

Merged
merged 2 commits into from
May 6, 2021

Conversation

jackh726
Copy link
Member

Fixes #84398

This is kind of a hack. I wonder if we can get other types of candidates that are the same except for bound vars. This won't be a problem with Chalk, since we don't really need to know that there are two different "candidates" if they both give the same final substitution.

r? @nikomatsakis

@jackh726 jackh726 added the WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804 label Apr 25, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2021
// the same except for unused bound vars. Just pick the current one (the should
// both evaluate to the same answer). This is probably best characterized as a
// "hack", since we might prefer to just do our best to *not* create essentially
// duplicate candidates in the first place.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we want to pick the one with fewer bound vars? it'd be nice to be more deterministic here

@pietroalbini pietroalbini added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 4, 2021
@pietroalbini
Copy link
Member

This fixes a regression that slipped into beta 1.53, nominating for backport.

@jackh726
Copy link
Member Author

jackh726 commented May 4, 2021

Status on this: discussed with @nikomatsakis a change he'd like to see here. Just have to get some time to implement it.

@jackh726 jackh726 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 4, 2021
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 6, 2021

📌 Commit c1ef0f3 has been approved by nikomatsakis

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 6, 2021
@Mark-Simulacrum
Copy link
Member

@bors rollup=never p=1 we want this into master and backported soon, but I also want perf individually on it (no need to prerun)

@apiraino
Copy link
Contributor

apiraino commented May 6, 2021

Beta backport accepted as per compiler team on Zulip. Meanwhile a crater run could help assessing if this PR has any breakage.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label May 6, 2021
@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 6, 2021
@bors
Copy link
Contributor

bors commented May 6, 2021

⌛ Testing commit c1ef0f3 with merge 377d1a9...

@bors
Copy link
Contributor

bors commented May 6, 2021

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing 377d1a9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 6, 2021
@bors bors merged commit 377d1a9 into rust-lang:master May 6, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 6, 2021
@jackh726 jackh726 deleted the issue-84398 branch May 6, 2021 21:06
@jackh726 jackh726 restored the issue-84398 branch May 6, 2021 21:06
bors added a commit to rust-lang-ci/rust that referenced this pull request May 7, 2021
…ulacrum

[beta] backports

First-ish round of beta backports:

*  [beta] backport for rust-lang#84769 rust-lang#84969
*  [beta] Bump stage0 to production 1.52.0 rust-lang#84994
*  Deduplicate ParamCandidates with the same value except for bound vars rust-lang#84559
@jackh726 jackh726 deleted the issue-84398 branch May 7, 2021 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. merged-by-bors This PR was explicitly merged by bors. 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-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type annotations needed error on definition site
8 participants