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