about summary refs log tree commit diff
path: root/src/liballoc_system
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-05 00:22:14 +0000
committerbors <bors@rust-lang.org>2018-07-05 00:22:14 +0000
commitb51ca20ce52716d8eda4797425faba3960409e13 (patch)
tree5259c7e9bbbc8ac21120301d4e311aa47bfea9fb /src/liballoc_system
parentafaa40646542ca1e8fadb7e1d34197237e0fcd19 (diff)
parent125c9d99e58466b27f2b01f3865e6668d4c196ff (diff)
downloadrust-b51ca20ce52716d8eda4797425faba3960409e13.tar.gz
rust-b51ca20ce52716d8eda4797425faba3960409e13.zip
Auto merge of #51964 - matthewjasper:unused-mut-mir-generation, r=nikomatsakis
[NLL] Fix various unused mut errors

Closes #51801
Closes #50897
Closes #51830
Closes #51904
cc #51918 - keeping this one open in case there are any more issues

This PR contains multiple changes. List of changes with examples of what they fix:

* Change mir generation so that the parameter variable doesn't get a name when a `ref` pattern is used as an argument
```rust
fn f(ref y: i32) {} // doesn't trigger lint
```
* Change mir generation so that by-move closure captures don't get first moved into a temporary.
```rust
let mut x = 0; // doesn't trigger lint
move || {
    x = 1;
};
```
* Treat generator upvars the same as closure upvars
```rust
let mut x = 0; // This mut is now necessary and is not linted against.
move || {
    x = 1;
    yield;
};
```

r? @nikomatsakis
Diffstat (limited to 'src/liballoc_system')
0 files changed, 0 insertions, 0 deletions