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