Rollup merge of #44590 - oli-obk:allow_unused_mut_on_vars, r=eddyb

Get `allow(unused_mut)` to work on `let` bindings

fixes #40491
This commit is contained in:
Alex Crichton 2017-09-16 09:16:58 -05:00
commit c4f29d4cc5
2 changed files with 12 additions and 12 deletions

View file

@ -110,3 +110,11 @@ fn foo(mut a: isize) {
let mut a = 3;
let mut b = vec![2];
}
// make sure the lint attribute can be turned off on let statements
#[deny(unused_mut)]
fn bar() {
#[allow(unused_mut)]
let mut a = 3;
let mut b = vec![2]; //~ ERROR: variable does not need to be mutable
}