1 error[E0500]: closure requires unique access to `x` but it is already borrowed
2 --> $DIR/borrowck-closures-unique.rs:26:14
4 LL | let c1 = || get(x);
5 | -- - first borrow occurs due to use of `x` in closure
8 LL | let c2 = || set(x);
9 | ^^ - second borrow occurs due to use of `x` in closure
11 | closure construction occurs here
13 | -- first borrow later used here
15 error[E0500]: closure requires unique access to `x` but it is already borrowed
16 --> $DIR/borrowck-closures-unique.rs:32:14
18 LL | let c1 = || get(x);
19 | -- - first borrow occurs due to use of `x` in closure
22 LL | let c2 = || { get(x); set(x); };
23 | ^^ - second borrow occurs due to use of `x` in closure
25 | closure construction occurs here
27 | -- first borrow later used here
29 error[E0524]: two closures require unique access to `x` at the same time
30 --> $DIR/borrowck-closures-unique.rs:38:14
32 LL | let c1 = || set(x);
33 | -- - first borrow occurs due to use of `x` in closure
35 | first closure is constructed here
36 LL | let c2 = || set(x);
37 | ^^ - second borrow occurs due to use of `x` in closure
39 | second closure is constructed here
41 | -- first borrow later used here
43 error[E0594]: cannot assign to `x`, as it is not declared as mutable
44 --> $DIR/borrowck-closures-unique.rs:43:38
46 LL | fn e(x: &'static mut isize) {
47 | - help: consider changing this to be mutable: `mut x`
48 LL | let c1 = |y: &'static mut isize| x = y;
51 error: aborting due to 4 previous errors
53 Some errors have detailed explanations: E0500, E0524, E0594.
54 For more information about an error, try `rustc --explain E0500`.