1
Fork 0

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:
Huon Wilson 2013-11-16 00:39:48 +11:00
parent 90754ae9c9
commit 6bd8bb51a0
2 changed files with 21 additions and 14 deletions

View file

@ -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()) {}