We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c854db commit d1fffd8Copy full SHA for d1fffd8
src/test/compile-fail/lint-unused-mut-variables.rs
@@ -54,6 +54,12 @@ fn main() {
54
let mut b = (&mut a,);
55
*b.0 = 4; //~^ ERROR: variable does not need to be mutable
56
57
+ let mut x = &mut 1; //~ ERROR: variable does not need to be mutable
58
+ let mut f = || {
59
+ *x += 1;
60
+ };
61
+ f();
62
+
63
fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] {
64
&mut arg[..] //~^ ERROR: variable does not need to be mutable
65
}
0 commit comments