lint: _-prefixed variables don't get an unused-mut warning.
Bringing it into line with the unused-variable one, fn main() { let mut _a = 1; } will not warn that `_a` is never used mutably. Fixes #6911.
This commit is contained in:
parent
90754ae9c9
commit
6bd8bb51a0
2 changed files with 21 additions and 14 deletions
|
@ -49,6 +49,10 @@ fn main() {
|
|||
|
||||
let x = |mut y: int| y = 32;
|
||||
fn nothing(mut foo: int) { foo = 37; }
|
||||
|
||||
// leading underscore should avoid the warning, just like the
|
||||
// unused variable lint.
|
||||
let mut _allowed = 1;
|
||||
}
|
||||
|
||||
fn callback(f: &fn()) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue