]> git.proxmox.com Git - rustc.git/blame - src/doc/book/listings/ch16-fearless-concurrency/listing-16-14/output.txt
New upstream version 1.59.0+dfsg1
[rustc.git] / src / doc / book / listings / ch16-fearless-concurrency / listing-16-14 / output.txt
CommitLineData
74b04a01
XL
1$ cargo run
2 Compiling shared-state v0.1.0 (file:///projects/shared-state)
fc512014 3error[E0277]: `Rc<Mutex<i32>>` cannot be sent between threads safely
74b04a01
XL
4 --> src/main.rs:11:22
5 |
fc512014
XL
611 | let handle = thread::spawn(move || {
7 | ______________________^^^^^^^^^^^^^_-
8 | | |
9 | | `Rc<Mutex<i32>>` cannot be sent between threads safely
1012 | | let mut num = counter.lock().unwrap();
1113 | |
1214 | | *num += 1;
1315 | | });
14 | |_________- within this `[closure@src/main.rs:11:36: 15:10]`
74b04a01 15 |
fc512014
XL
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]`
a2a8927a 18note: required by a bound in `spawn`
74b04a01 19
74b04a01 20For more information about this error, try `rustc --explain E0277`.
c295e0f8 21error: could not compile `shared-state` due to previous error