1
Fork 0

Make the unused_mut lint smarter with respect to locals.

Fixes #26332
This commit is contained in:
Ariel Ben-Yehuda 2015-06-18 01:02:58 +03:00 committed by Ariel Ben-Yehuda
parent 2f45294a50
commit a18d9842ed
7 changed files with 23 additions and 23 deletions

View file

@ -23,6 +23,15 @@ fn main() {
let mut b = 3; //~ ERROR: variable does not need to be mutable
let mut a = vec!(3); //~ ERROR: variable does not need to be mutable
let (mut a, b) = (1, 2); //~ ERROR: variable does not need to be mutable
let mut a; //~ ERROR: variable does not need to be mutable
a = 3;
let mut b; //~ ERROR: variable does not need to be mutable
if true {
b = 3;
} else {
b = 4;
}
match 30 {
mut x => {} //~ ERROR: variable does not need to be mutable