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

@petrochenkov petrochenkov commented Nov 10, 2015

Closes #29746

@rust-highfive
Copy link
Collaborator

@rust-highfive rust-highfive commented Nov 10, 2015

r? @nikomatsakis

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

@petrochenkov petrochenkov force-pushed the petrochenkov:issue29746 branch from f827585 to 6070c3d Nov 10, 2015
@petrochenkov
Copy link
Contributor Author

@petrochenkov petrochenkov commented Nov 10, 2015

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 petrochenkov force-pushed the petrochenkov:issue29746 branch from 6070c3d to fa3cd51 Nov 10, 2015
@petrochenkov
Copy link
Contributor Author

@petrochenkov petrochenkov commented Nov 10, 2015

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

@brson
Copy link
Contributor

@brson brson commented Nov 10, 2015

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

@petrochenkov
Copy link
Contributor Author

@petrochenkov petrochenkov commented Nov 10, 2015

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 petrochenkov force-pushed the petrochenkov:issue29746 branch from fa3cd51 to 2504e31 Nov 10, 2015
@petrochenkov
Copy link
Contributor Author

@petrochenkov petrochenkov commented Nov 10, 2015

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 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 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

@nikomatsakis nikomatsakis commented Nov 11, 2015

r? @nrc (since he already reviewed)

@petrochenkov petrochenkov force-pushed the petrochenkov:issue29746 branch from 2504e31 to fba1926 Nov 11, 2015
@petrochenkov
Copy link
Contributor Author

@petrochenkov petrochenkov commented Nov 11, 2015

Rebased.

@nrc
Copy link
Member

@nrc nrc commented Nov 11, 2015

@bors: r+

@bors
Copy link
Contributor

@bors bors commented Nov 11, 2015

📌 Commit fba1926 has been approved by nrc

@bors
Copy link
Contributor

@bors 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
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
homu Test successful
Details
@nikomatsakis
Copy link
Contributor

@nikomatsakis nikomatsakis commented Nov 12, 2015

Accepted for beta because this is a regression.

@brson
Copy link
Contributor

@brson 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?

@petrochenkov petrochenkov deleted the petrochenkov:issue29746 branch Nov 22, 2015
@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants