Skip to content

Commit

Permalink
Make hint clearer, with the potential of being wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 15, 2018
1 parent fe19754 commit cb5667e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/closure-move-sync.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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<()>`
Expand All @@ -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<()>`
Expand Down

0 comments on commit cb5667e

Please sign in to comment.