Added closure test case.
This commit is contained in:
parent
9c854db82b
commit
d1fffd8685
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue