]> git.proxmox.com Git - rustc.git/blame - src/doc/book/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt
New upstream version 1.50.0+dfsg1
[rustc.git] / src / doc / book / listings / ch16-fearless-concurrency / output-only-01-move-drop / output.txt
CommitLineData
74b04a01
XL
1$ cargo run
2 Compiling threads v0.1.0 (file:///projects/threads)
3error[E0382]: use of moved value: `v`
4 --> src/main.rs:10:10
5 |
64 | let v = vec![1, 2, 3];
fc512014 7 | - move occurs because `v` has type `Vec<i32>`, which does not implement the `Copy` trait
74b04a01
XL
85 |
96 | let handle = thread::spawn(move || {
10 | ------- value moved into closure here
117 | println!("Here's a vector: {:?}", v);
12 | - variable moved due to use in closure
13...
1410 | drop(v); // oh no!
15 | ^ value used here after move
16
17error: aborting due to previous error
18
19For more information about this error, try `rustc --explain E0382`.
fc512014 20error: could not compile `threads`
74b04a01
XL
21
22To learn more, run the command again with --verbose.