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

borrowck: classify expressions as assignees, uses or both #12733

Merged
merged 1 commit into from
Mar 10, 2014

Conversation

edwardw
Copy link
Contributor

@edwardw edwardw commented Mar 6, 2014

  • Repurposes MoveData.assignee_ids to mean only = but not +=, so
    that borrowck effectively classifies all expressions into assignees,
    uses or both.
  • Removes two span_err in liveness analysis, which are now borrowck's
    responsibilities.

Closes #12527.

@alexcrichton
Copy link
Member

I canceled the build, @nikomatsakis seemed to have concerns

- Repurposes `MoveData.assignee_ids` to mean only `=` but not `+=`, so
  that borrowck effectively classifies all expressions into assignees,
  uses or both.
- Removes two `span_err` in liveness analysis, which are now borrowck's
  responsibilities.

Closes rust-lang#12527.
bors added a commit that referenced this pull request Mar 9, 2014
- Repurposes `MoveData.assignee_ids` to mean only `=` but not `+=`, so
  that borrowck effectively classifies all expressions into assignees,
  uses or both.
- Removes two `span_err` in liveness analysis, which are now borrowck's
  responsibilities.
    
Closes #12527.
bors added a commit that referenced this pull request Mar 10, 2014
- Repurposes `MoveData.assignee_ids` to mean only `=` but not `+=`, so
  that borrowck effectively classifies all expressions into assignees,
  uses or both.
- Removes two `span_err` in liveness analysis, which are now borrowck's
  responsibilities.
    
Closes #12527.
@bors bors closed this Mar 10, 2014
@bors bors merged commit abfde39 into rust-lang:master Mar 10, 2014
@edwardw edwardw deleted the rw-liveness branch March 11, 2014 05:29
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 2, 2024
suppress `readonly_write_lock` for underscore-prefixed bindings

Fixes rust-lang#12733

Unsure if there's a better way to prevent this kind of false positive but this is the one that made most sense to me.
In my experience, prefixing bindings with an underscore is the usual way to name variables that aren't used and that exist purely for executing drop code at the end of the scope.

-------

changelog: suppress [`readonly_write_lock`] for underscore-prefixed bindings
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.

Compound assignment (+=) on uninitialized variables is allowed
4 participants