]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-loan-blocks-move-cc.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-loan-blocks-move-cc.stderr
1 error[E0505]: cannot move out of `v` because it is borrowed
2   --> $DIR/borrowck-loan-blocks-move-cc.rs:14:19
3    |
4 LL |     let w = &v;
5    |             -- borrow of `v` occurs here
6 LL |     thread::spawn(move|| {
7    |                   ^^^^^^ move out of `v` occurs here
8 LL |
9 LL |         println!("v={}", *v);
10    |                          -- move occurs due to use in closure
11 LL |     });
12 LL |     w.use_ref();
13    |     ----------- borrow later used here
14
15 error[E0505]: cannot move out of `v` because it is borrowed
16   --> $DIR/borrowck-loan-blocks-move-cc.rs:24:19
17    |
18 LL |     let w = &v;
19    |             -- borrow of `v` occurs here
20 LL |     thread::spawn(move|| {
21    |                   ^^^^^^ move out of `v` occurs here
22 LL |
23 LL |         println!("v={}", *v);
24    |                          -- move occurs due to use in closure
25 LL |     });
26 LL |     w.use_ref();
27    |     ----------- borrow later used here
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0505`.