1 error[E0382]: use of moved value: `x`
2 --> $DIR/closures-in-loops.rs:8:9
5 | ^^ - use occurs due to use in closure
7 | value moved into closure here, in previous iteration of loop
9 = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
11 error[E0499]: cannot borrow `x` as mutable more than once at a time
12 --> $DIR/closures-in-loops.rs:15:16
14 LL | v.push(|| x = String::new()); //~ ERROR
15 | ^^ - borrows occur due to use of `x` in closure
17 | mutable borrow starts here in previous iteration of loop
19 error[E0524]: two closures require unique access to `x` at the same time
20 --> $DIR/closures-in-loops.rs:22:16
22 LL | v.push(|| *x = String::new()); //~ ERROR
23 | ^^ - borrows occur due to use of `x` in closure
25 | closures are constructed here in different iterations of loop
27 error: aborting due to 3 previous errors
29 Some errors occurred: E0382, E0499, E0524.
30 For more information about an error, try `rustc --explain E0382`.