Skip to content

Correctly detect reassignments to the interior of matched structs/tuples #27011

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

Merged
merged 1 commit into from
Jul 13, 2015

Conversation

dotdash
Copy link
Contributor

@dotdash dotdash commented Jul 13, 2015

If we match a whole struct or tuple, the "field" for the reassignment
checker will be "None" which means that mutating any field should count
as a reassignment.

Fixes #26996.

If we match a whole struct or tuple, the "field" for the reassignment
checker will be "None" which means that mutating any field should count
as a reassignment.

Fixes rust-lang#26996.
@rust-highfive
Copy link
Contributor

r? @brson

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

@luqmana luqmana assigned luqmana and unassigned brson Jul 13, 2015
@pnkfelix
Copy link
Member

(my preference would be to stop using an Option to represent the scenario here, since I find it quite the meaning of None here to be somewhat less than intuitive. But I suspect a lot of this code is going to be rewritten anyway assuming we go through with our planned switch to a MIR, so I won't block this change based on that personal preference.)

@pnkfelix
Copy link
Member

@bors r+ 043d7b5

@luqmana
Copy link
Member

luqmana commented Jul 13, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 13, 2015

📌 Commit 043d7b5 has been approved by luqmana

@bors
Copy link
Collaborator

bors commented Jul 13, 2015

⌛ Testing commit 043d7b5 with merge df39a92...

bors added a commit that referenced this pull request Jul 13, 2015
If we match a whole struct or tuple, the "field" for the reassignment
checker will be "None" which means that mutating any field should count
as a reassignment.

Fixes #26996.
@bors bors merged commit 043d7b5 into rust-lang:master Jul 13, 2015
@dotdash dotdash deleted the issue-26996 branch July 27, 2015 08:49
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.

6 participants