1 // Tests that two closures cannot simultaneously have mutable
2 // and immutable access to the variable. Issue #6801.
4 fn set(x: &mut isize) {
9 let mut c1 = || set(&mut *x);
10 //~^ ERROR cannot borrow
11 let mut c2 = || set(&mut *x);
12 //~^ ERROR cannot borrow
13 //~| ERROR two closures require unique access to `x` at the same time