]> git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch16-fearless-concurrency/listing-16-14/output.txt
New upstream version 1.50.0+dfsg1
[rustc.git] / src / doc / book / listings / ch16-fearless-concurrency / listing-16-14 / output.txt
1 $ cargo run
2 Compiling shared-state v0.1.0 (file:///projects/shared-state)
3 error[E0277]: `Rc<Mutex<i32>>` cannot be sent between threads safely
4 --> src/main.rs:11:22
5 |
6 11 | let handle = thread::spawn(move || {
7 | ______________________^^^^^^^^^^^^^_-
8 | | |
9 | | `Rc<Mutex<i32>>` cannot be sent between threads safely
10 12 | | let mut num = counter.lock().unwrap();
11 13 | |
12 14 | | *num += 1;
13 15 | | });
14 | |_________- within this `[closure@src/main.rs:11:36: 15:10]`
15 |
16 = help: within `[closure@src/main.rs:11:36: 15:10]`, the trait `Send` is not implemented for `Rc<Mutex<i32>>`
17 = note: required because it appears within the type `[closure@src/main.rs:11:36: 15:10]`
18
19 error: aborting due to previous error
20
21 For more information about this error, try `rustc --explain E0277`.
22 error: could not compile `shared-state`
23
24 To learn more, run the command again with --verbose.