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

Fix hygiene regression in patterns #29748

Merged
merged 1 commit into from
Nov 12, 2015
Merged

Conversation

petrochenkov
Copy link
Contributor

Closes #29746

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

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

@petrochenkov
Copy link
Contributor Author

Hm, no, this breaks other things.
It looks like the change in 40ce804, causing this regression, at the same time fixed some ICEs, like #23891 and #27320.
It needs further investigation.

@petrochenkov
Copy link
Contributor Author

Ok, now all tests pass.
It's strange, however, that mtwt::resolve is needed during type checking.

@brson brson 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 Nov 10, 2015
@brson
Copy link
Contributor

brson commented Nov 10, 2015

Nominating for backport. Linked issues says this is on beta. cc @rust-lang/compiler

@petrochenkov
Copy link
Contributor Author

It looks like there are couple of very similar issues in rustc_trans and rustc_mir, in places where "the first of bindings with the same name" is needed in match.

match x {
    pat1(a) | pat2(a) | pat3(a) => {}
         ^ the first `a` is here, `a`s have to be compared hygienically
}

@petrochenkov
Copy link
Contributor Author

Updated with fixes for mir and trans.
Ideally, resolve should build some special table for these cases and save it for later, so mtwt tables could be cleared immediately after name resolution.

@bors
Copy link
Contributor

bors commented Nov 11, 2015

☔ The latest upstream changes (presumably #29763) made this pull request unmergeable. Please resolve the merge conflicts.

@nrc
Copy link
Member

nrc commented Nov 11, 2015

r+ with a rebase.

I am really unhappy about keeping the mtwt tables around longer than we have to - this will cause memory use and possibly compile time regressions. But I guess it is better to be slow and correct. I'll file an issue for a better fix.

@nikomatsakis
Copy link
Contributor

r? @nrc (since he already reviewed)

@petrochenkov
Copy link
Contributor Author

Rebased.

@nrc
Copy link
Member

nrc commented Nov 11, 2015

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 11, 2015

📌 Commit fba1926 has been approved by nrc

@bors
Copy link
Contributor

bors commented Nov 11, 2015

⌛ Testing commit fba1926 with merge cc30948...

bors added a commit that referenced this pull request Nov 11, 2015
@bors bors merged commit fba1926 into rust-lang:master Nov 12, 2015
@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Nov 12, 2015
@nikomatsakis
Copy link
Contributor

Accepted for beta because this is a regression.

@brson
Copy link
Contributor

brson commented Nov 20, 2015

This doesn't cherry-pick cleanly at all. Can somebody else do it in the next week or so? @petrochenkov perhaps?

@brson brson removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 21, 2015
@petrochenkov petrochenkov deleted the issue29746 branch November 22, 2015 11:37
@petrochenkov petrochenkov mentioned this pull request May 16, 2016
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants