2017-11-11 03:15:26 -06:00
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:24:24
|
|
|
|
|
|
|
|
|
23 | let c1 = to_fn_mut(|| x = 4);
|
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
|
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
25 | //~| ERROR cannot borrow `x` as mutable more than once
|
|
|
|
26 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:35:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
34 | let c1 = to_fn_mut(|| set(&mut x));
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
35 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
36 | //~| ERROR cannot borrow `x` as mutable more than once
|
|
|
|
37 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
41 | let c1 = to_fn_mut(|| x = 5);
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
42 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
43 | //~| ERROR cannot borrow `x` as mutable more than once
|
|
|
|
44 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:49:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
48 | let c1 = to_fn_mut(|| x = 5);
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
49 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
...
|
|
|
|
52 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:61:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
60 | let c1 = to_fn_mut(|| set(&mut *x.f));
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
61 | let c2 = to_fn_mut(|| set(&mut *x.f));
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
...
|
|
|
|
64 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:24:24
|
|
|
|
|
|
|
|
|
23 | let c1 = to_fn_mut(|| x = 4);
|
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
|
|
|
24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
|
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
25 | //~| ERROR cannot borrow `x` as mutable more than once
|
|
|
|
26 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:35:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
34 | let c1 = to_fn_mut(|| set(&mut x));
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
35 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
36 | //~| ERROR cannot borrow `x` as mutable more than once
|
|
|
|
37 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
41 | let c1 = to_fn_mut(|| x = 5);
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
42 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
43 | //~| ERROR cannot borrow `x` as mutable more than once
|
|
|
|
44 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:49:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
48 | let c1 = to_fn_mut(|| x = 5);
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
49 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
...
|
|
|
|
52 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
|
2017-11-20 06:13:27 -06:00
|
|
|
--> $DIR/borrowck-closures-two-mut.rs:61:24
|
2017-11-11 03:15:26 -06:00
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
60 | let c1 = to_fn_mut(|| set(&mut *x.f));
|
2017-11-11 03:15:26 -06:00
|
|
|
| -- - previous borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| first mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
61 | let c2 = to_fn_mut(|| set(&mut *x.f));
|
2017-11-11 03:15:26 -06:00
|
|
|
| ^^ - borrow occurs due to use of `x` in closure
|
|
|
|
| |
|
|
|
|
| second mutable borrow occurs here
|
2017-11-20 06:13:27 -06:00
|
|
|
...
|
|
|
|
64 | }
|
2017-11-11 03:15:26 -06:00
|
|
|
| - first borrow ends here
|
|
|
|
|
|
|
|
error: aborting due to 10 previous errors
|
|
|
|
|
2018-02-19 14:40:25 -06:00
|
|
|
If you want more information on this error, try using "rustc --explain E0499"
|