Make hint clearer, with the potential of being wrong
This commit is contained in:
parent
fe1975448c
commit
cb5667eaa5
2 changed files with 4 additions and 4 deletions
|
@ -346,11 +346,11 @@ pub trait Copy : Clone {
|
|||
#[rustc_on_unimplemented(
|
||||
on(
|
||||
_Self="std::sync::mpsc::Receiver<T>",
|
||||
label="`{Self}` cannot be shared safely, if using a closure consider marking it `move`"
|
||||
label="`{Self}` cannot be shared safely, consider marking the closure `move`"
|
||||
),
|
||||
on(
|
||||
_Self="std::sync::mpsc::Sender<T>",
|
||||
label="`{Self}` cannot be shared safely, if using a closure consider marking it `move`"
|
||||
label="`{Self}` cannot be shared safely, consider marking the closure `move`"
|
||||
),
|
||||
message="`{Self}` cannot be shared between threads safely",
|
||||
label="`{Self}` cannot be shared between threads safely"
|
||||
|
|
|
@ -2,7 +2,7 @@ error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads s
|
|||
--> $DIR/closure-move-sync.rs:16:13
|
||||
|
|
||||
16 | let t = thread::spawn(|| {
|
||||
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared safely, if using a closure consider marking it `move`
|
||||
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared safely, consider marking the closure `move`
|
||||
|
|
||||
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
|
||||
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>`
|
||||
|
@ -13,7 +13,7 @@ error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads saf
|
|||
--> $DIR/closure-move-sync.rs:28:5
|
||||
|
|
||||
28 | thread::spawn(|| tx.send(()).unwrap());
|
||||
| ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared safely, if using a closure consider marking it `move`
|
||||
| ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared safely, consider marking the closure `move`
|
||||
|
|
||||
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
|
||||
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue