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

Properly unify consts with vars #598

Merged
merged 2 commits into from
Sep 2, 2020

Conversation

nathanwhit
Copy link
Member

Before, we incorrectly unified consts with vars unconditionally.

Fixes #597.

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

One small comment. These seem mostly copied from the Ty cases, and that makes sense to me. But I would really like a second look from @nikomatsakis or maybe @Areredify in terms of whether this is actually correct (and why it was left out of the original PR i.e. was it just oversight or something else)

self.table
.unify
.unify_var_value(var, InferenceValue::from_const(interner, c.clone()))
.unify_var_value(var, InferenceValue::from_const(interner, c1.clone()))
Copy link
Member

Choose a reason for hiding this comment

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

Does this actually need to be a clone? The line below uses c (though should probably be c1), but we could print that before this.

@basil-cow
Copy link
Contributor

Oh yeah, it was most certainly an oversight. I actually saw it when working on universe canonicalization but forgot to push it separately

@jackh726
Copy link
Member

jackh726 commented Sep 2, 2020

@bors r+

book links are broken with latest rust directory moving around business, but we can leave that for another PR

@bors
Copy link
Contributor

bors commented Sep 2, 2020

📌 Commit 584ddfe has been approved by jackh726

@bors
Copy link
Contributor

bors commented Sep 2, 2020

⌛ Testing commit 584ddfe with merge bad9431...

@bors
Copy link
Contributor

bors commented Sep 2, 2020

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing bad9431 to master...

@bors bors merged commit bad9431 into rust-lang:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exists-forall gives false solution for consts
4 participants