Skip to content

Allow mutation of moved upvars when they're marked as mutable. #16253

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 3 commits into from
Aug 9, 2014

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Aug 4, 2014

Fixes #11958.

@nikomatsakis
Copy link
Contributor

/me will review

@nikomatsakis
Copy link
Contributor

This looks good. Sorry it took me some time. The main thing that's missing are more tests. There ought to be tests for:

  1. Mutation is allowed if declared mutable (you have this).
  2. Mutation is NOT allowed if NOT declared mutable (didn't see this).
  3. Tests for lint:
    • set the lint mode to forbid and add that to test Thread a session or semantic context through IL #1 so as to test that we don't get spurious errors here
    • set the lint mode to forbid and then write a test that reads let mut (with a closure) but does not mutate it, and check that you do in fact get a warning

bors added a commit that referenced this pull request Aug 9, 2014
@bors bors closed this Aug 9, 2014
@bors bors merged commit f765759 into rust-lang:master Aug 9, 2014
@luqmana luqmana deleted the muv branch August 9, 2014 14:00
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.

Procs do not capture mutability
3 participants