Added closure test case.

This commit is contained in:
Isaac van Bakel 2017-08-06 18:25:31 +01:00
parent 9c854db82b
commit d1fffd8685

View File

@ -54,6 +54,12 @@ fn main() {
let mut b = (&mut a,);
*b.0 = 4; //~^ ERROR: variable does not need to be mutable
let mut x = &mut 1; //~ ERROR: variable does not need to be mutable
let mut f = || {
*x += 1;
};
f();
fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] {
&mut arg[..] //~^ ERROR: variable does not need to be mutable
}