1 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
2 --> $DIR/borrowck-closures-two-mut.rs:24:24
4 23 | let c1 = to_fn_mut(|| x = 4);
5 | -- - previous borrow occurs due to use of `x` in closure
7 | first mutable borrow occurs here
8 24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
9 | ^^ - borrow occurs due to use of `x` in closure
11 | second mutable borrow occurs here
13 | - first borrow ends here
15 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
16 --> $DIR/borrowck-closures-two-mut.rs:34:24
18 33 | let c1 = to_fn_mut(|| set(&mut x));
19 | -- - previous borrow occurs due to use of `x` in closure
21 | first mutable borrow occurs here
22 34 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
23 | ^^ - borrow occurs due to use of `x` in closure
25 | second mutable borrow occurs here
27 | - first borrow ends here
29 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
30 --> $DIR/borrowck-closures-two-mut.rs:40:24
32 39 | let c1 = to_fn_mut(|| x = 5);
33 | -- - previous borrow occurs due to use of `x` in closure
35 | first mutable borrow occurs here
36 40 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
37 | ^^ - borrow occurs due to use of `x` in closure
39 | second mutable borrow occurs here
41 | - first borrow ends here
43 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
44 --> $DIR/borrowck-closures-two-mut.rs:46:24
46 45 | let c1 = to_fn_mut(|| x = 5);
47 | -- - previous borrow occurs due to use of `x` in closure
49 | first mutable borrow occurs here
50 46 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
51 | ^^ - borrow occurs due to use of `x` in closure
53 | second mutable borrow occurs here
54 47 | //~^ ERROR cannot borrow `x` as mutable more than once
56 | - first borrow ends here
58 error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
59 --> $DIR/borrowck-closures-two-mut.rs:57:24
61 56 | let c1 = to_fn_mut(|| set(&mut *x.f));
62 | -- - previous borrow occurs due to use of `x` in closure
64 | first mutable borrow occurs here
65 57 | let c2 = to_fn_mut(|| set(&mut *x.f));
66 | ^^ - borrow occurs due to use of `x` in closure
68 | second mutable borrow occurs here
69 58 | //~^ ERROR cannot borrow `x` as mutable more than once
71 | - first borrow ends here
73 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
74 --> $DIR/borrowck-closures-two-mut.rs:24:24
76 23 | let c1 = to_fn_mut(|| x = 4);
77 | -- - previous borrow occurs due to use of `x` in closure
79 | first mutable borrow occurs here
80 24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
81 | ^^ - borrow occurs due to use of `x` in closure
83 | second mutable borrow occurs here
85 | - first borrow ends here
87 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
88 --> $DIR/borrowck-closures-two-mut.rs:34:24
90 33 | let c1 = to_fn_mut(|| set(&mut x));
91 | -- - previous borrow occurs due to use of `x` in closure
93 | first mutable borrow occurs here
94 34 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
95 | ^^ - borrow occurs due to use of `x` in closure
97 | second mutable borrow occurs here
99 | - first borrow ends here
101 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
102 --> $DIR/borrowck-closures-two-mut.rs:40:24
104 39 | let c1 = to_fn_mut(|| x = 5);
105 | -- - previous borrow occurs due to use of `x` in closure
107 | first mutable borrow occurs here
108 40 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
109 | ^^ - borrow occurs due to use of `x` in closure
111 | second mutable borrow occurs here
113 | - first borrow ends here
115 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
116 --> $DIR/borrowck-closures-two-mut.rs:46:24
118 45 | let c1 = to_fn_mut(|| x = 5);
119 | -- - previous borrow occurs due to use of `x` in closure
121 | first mutable borrow occurs here
122 46 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
123 | ^^ - borrow occurs due to use of `x` in closure
125 | second mutable borrow occurs here
126 47 | //~^ ERROR cannot borrow `x` as mutable more than once
128 | - first borrow ends here
130 error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir)
131 --> $DIR/borrowck-closures-two-mut.rs:57:24
133 56 | let c1 = to_fn_mut(|| set(&mut *x.f));
134 | -- - previous borrow occurs due to use of `x` in closure
136 | first mutable borrow occurs here
137 57 | let c2 = to_fn_mut(|| set(&mut *x.f));
138 | ^^ - borrow occurs due to use of `x` in closure
140 | second mutable borrow occurs here
141 58 | //~^ ERROR cannot borrow `x` as mutable more than once
143 | - first borrow ends here
145 error: aborting due to 10 previous errors