Skip to content

Commit cb5667e

Browse files
committed
Make hint clearer, with the potential of being wrong
1 parent fe19754 commit cb5667e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libcore/marker.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,11 @@ pub trait Copy : Clone {
346346
#[rustc_on_unimplemented(
347347
on(
348348
_Self="std::sync::mpsc::Receiver<T>",
349-
label="`{Self}` cannot be shared safely, if using a closure consider marking it `move`"
349+
label="`{Self}` cannot be shared safely, consider marking the closure `move`"
350350
),
351351
on(
352352
_Self="std::sync::mpsc::Sender<T>",
353-
label="`{Self}` cannot be shared safely, if using a closure consider marking it `move`"
353+
label="`{Self}` cannot be shared safely, consider marking the closure `move`"
354354
),
355355
message="`{Self}` cannot be shared between threads safely",
356356
label="`{Self}` cannot be shared between threads safely"

src/test/ui/closure-move-sync.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads s
22
--> $DIR/closure-move-sync.rs:16:13
33
|
44
16 | let t = thread::spawn(|| {
5-
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared safely, if using a closure consider marking it `move`
5+
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared safely, consider marking the closure `move`
66
|
77
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
88
= 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
1313
--> $DIR/closure-move-sync.rs:28:5
1414
|
1515
28 | thread::spawn(|| tx.send(()).unwrap());
16-
| ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared safely, if using a closure consider marking it `move`
16+
| ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared safely, consider marking the closure `move`
1717
|
1818
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
1919
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`

0 commit comments

Comments
 (0)