fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB35 linesraw
1error[E0505]: cannot move out of `v` because it is borrowed
2  --> $DIR/borrowck-loan-blocks-move-cc.rs:14:19
3   |
4LL |     let v: Box<_> = Box::new(3);
5   |         - binding `v` declared here
6LL |     let w = &v;
7   |             -- borrow of `v` occurs here
8LL |     thread::spawn(move|| {
9   |                   ^^^^^^ move out of `v` occurs here
10LL |
11LL |         println!("v={}", *v);
12   |                          -- move occurs due to use in closure
13LL |     });
14LL |     w.use_ref();
15   |     - borrow later used here
16
17error[E0505]: cannot move out of `v` because it is borrowed
18  --> $DIR/borrowck-loan-blocks-move-cc.rs:24:19
19   |
20LL |     let v: Box<_> = Box::new(3);
21   |         - binding `v` declared here
22LL |     let w = &v;
23   |             -- borrow of `v` occurs here
24LL |     thread::spawn(move|| {
25   |                   ^^^^^^ move out of `v` occurs here
26LL |
27LL |         println!("v={}", *v);
28   |                          -- move occurs due to use in closure
29LL |     });
30LL |     w.use_ref();
31   |     - borrow later used here
32
33error: aborting due to 2 previous errors
34
35For more information about this error, try `rustc --explain E0505`.