]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-multiple-captures.nll.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / borrowck / borrowck-multiple-captures.nll.stderr
1 error[E0505]: cannot move out of `x1` because it is borrowed
2   --> $DIR/borrowck-multiple-captures.rs:12:19
3    |
4 LL |     let p1 = &x1;
5    |              --- borrow of `x1` occurs here
6 ...
7 LL |     thread::spawn(move|| {
8    |                   ^^^^^^ move out of `x1` occurs here
9 LL |         drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed
10    |              -- move occurs due to use in closure
11 ...
12 LL |     borrow(&*p1);
13    |            ---- borrow later used here
14
15 error[E0505]: cannot move out of `x2` because it is borrowed
16   --> $DIR/borrowck-multiple-captures.rs:12:19
17    |
18 LL |     let p2 = &x2;
19    |              --- borrow of `x2` occurs here
20 LL |     thread::spawn(move|| {
21    |                   ^^^^^^ move out of `x2` occurs here
22 LL |         drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed
23 LL |         drop(x2); //~ ERROR cannot move `x2` into closure because it is borrowed
24    |              -- move occurs due to use in closure
25 ...
26 LL |     borrow(&*p2);
27    |            ---- borrow later used here
28
29 error[E0382]: use of moved value: `x1`
30   --> $DIR/borrowck-multiple-captures.rs:25:19
31    |
32 LL |     drop(x1);
33    |          -- value moved here
34 ...
35 LL |     thread::spawn(move|| {
36    |                   ^^^^^^ value used here after move
37 LL |         drop(x1); //~ ERROR capture of moved value: `x1`
38    |              -- use occurs due to use in closure
39    |
40    = note: move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
41
42 error[E0382]: use of moved value: `x2`
43   --> $DIR/borrowck-multiple-captures.rs:25:19
44    |
45 LL |     drop(x2);
46    |          -- value moved here
47 LL |     thread::spawn(move|| {
48    |                   ^^^^^^ value used here after move
49 LL |         drop(x1); //~ ERROR capture of moved value: `x1`
50 LL |         drop(x2); //~ ERROR capture of moved value: `x2`
51    |              -- use occurs due to use in closure
52    |
53    = note: move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
54
55 error[E0382]: use of moved value: `x`
56   --> $DIR/borrowck-multiple-captures.rs:36:14
57    |
58 LL |         drop(x); //~ ERROR cannot move `x` into closure because it is borrowed
59    |              - value moved here
60 LL |         drop(x); //~ ERROR use of moved value: `x`
61    |              ^ value used here after move
62    |
63    = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
64
65 error[E0505]: cannot move out of `x` because it is borrowed
66   --> $DIR/borrowck-multiple-captures.rs:34:19
67    |
68 LL |     let p = &x;
69    |             -- borrow of `x` occurs here
70 LL |     thread::spawn(move|| {
71    |                   ^^^^^^ move out of `x` occurs here
72 LL |         drop(x); //~ ERROR cannot move `x` into closure because it is borrowed
73    |              - move occurs due to use in closure
74 ...
75 LL |     borrow(&*p);
76    |            --- borrow later used here
77
78 error[E0382]: use of moved value: `x`
79   --> $DIR/borrowck-multiple-captures.rs:46:14
80    |
81 LL |         drop(x); //~ ERROR capture of moved value: `x`
82    |              - value moved here
83 LL |         drop(x); //~ ERROR use of moved value: `x`
84    |              ^ value used here after move
85    |
86    = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
87
88 error[E0382]: use of moved value: `x`
89   --> $DIR/borrowck-multiple-captures.rs:44:19
90    |
91 LL |     drop(x);
92    |          - value moved here
93 LL |     thread::spawn(move|| {
94    |                   ^^^^^^ value used here after move
95 LL |         drop(x); //~ ERROR capture of moved value: `x`
96    |              - use occurs due to use in closure
97    |
98    = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
99
100 error: aborting due to 8 previous errors
101
102 Some errors occurred: E0382, E0505.
103 For more information about an error, try `rustc --explain E0382`.