_ => {}
}
- let x = |mut y: int| 10i; //~ ERROR: variable does not need to be mutable
+ let x = |&: mut y: int| 10i; //~ ERROR: variable does not need to be mutable
fn what(mut foo: int) {} //~ ERROR: variable does not need to be mutable
// positive cases
_ => {}
}
- let x = |mut y: int| y = 32i;
+ let x = |&mut: mut y: int| y = 32i;
fn nothing(mut foo: int) { foo = 37i; }
// leading underscore should avoid the warning, just like the
let mut _allowed = 1i;
}
-fn callback(f: ||) {}
+fn callback<F>(f: F) where F: FnOnce() {}
// make sure the lint attribute can be turned off
#[allow(unused_mut)]