]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-103624.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-103624.stderr
1 error[E0507]: cannot move out of `self.b`, as `self` is a captured variable in an `Fn` closure
2   --> $DIR/issue-103624.rs:16:13
3    |
4 LL |     async fn foo(&self) {
5    |                  ----- captured outer variable
6 LL |         let bar = self.b.bar().await;
7 LL |         spawn_blocking(move || {
8    |                        ------- captured by this `Fn` closure
9 LL |
10 LL |             self.b;
11    |             ^^^^^^ move occurs because `self.b` has type `StructB`, which does not implement the `Copy` trait
12
13 error[E0521]: borrowed data escapes outside of associated function
14   --> $DIR/issue-103624.rs:14:9
15    |
16 LL |       async fn foo(&self) {
17    |                    -----
18    |                    |
19    |                    `self` is a reference that is only valid in the associated function body
20    |                    let's call the lifetime of this reference `'1`
21 LL |           let bar = self.b.bar().await;
22 LL | /         spawn_blocking(move || {
23 LL | |
24 LL | |             self.b;
25 LL | |
26 LL | |         })
27    | |          ^
28    | |          |
29    | |__________`self` escapes the associated function body here
30    |            argument requires that `'1` must outlive `'static`
31
32 error: aborting due to 2 previous errors
33
34 Some errors have detailed explanations: E0507, E0521.
35 For more information about an error, try `rustc --explain E0507`.