about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-11 19:39:06 +0000
committerbors <bors@rust-lang.org>2019-12-11 19:39:06 +0000
commit27d6f55f47e8875e71083a28ed84ea5a88e1b596 (patch)
tree2f0866ff8e08df5d73b14362a3a4c0d9991dbfd5 /src/libcore
parent90b957a17c1abba979aa41234ce0993a61030e67 (diff)
parent5cd9f22464a3ae2620c384094986d9549eca182e (diff)
downloadrust-27d6f55f47e8875e71083a28ed84ea5a88e1b596.tar.gz
rust-27d6f55f47e8875e71083a28ed84ea5a88e1b596.zip
Auto merge of #65345 - davidtwco:issue-64130-async-send-sync-error-improvements, r=nikomatsakis
async/await: improve not-send errors, part 2

Part of #64130. Fixes #65667.

This PR improves the errors introduced in #64895 so that they have specialized messages for `Send` and `Sync`.

r? @nikomatsakis
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/marker.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index 86ee673cea9..288017b7ca5 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -29,6 +29,7 @@ use crate::hash::Hasher;
 /// [arc]: ../../std/sync/struct.Arc.html
 /// [ub]: ../../reference/behavior-considered-undefined.html
 #[stable(feature = "rust1", since = "1.0.0")]
+#[cfg_attr(not(test), rustc_diagnostic_item = "send_trait")]
 #[rustc_on_unimplemented(
     message="`{Self}` cannot be sent between threads safely",
     label="`{Self}` cannot be sent between threads safely"
@@ -440,6 +441,7 @@ pub macro Copy($item:item) { /* compiler built-in */ }
 /// [ub]: ../../reference/behavior-considered-undefined.html
 /// [transmute]: ../../std/mem/fn.transmute.html
 #[stable(feature = "rust1", since = "1.0.0")]
+#[cfg_attr(not(test), rustc_diagnostic_item = "sync_trait")]
 #[lang = "sync"]
 #[rustc_on_unimplemented(
     message="`{Self}` cannot be shared between threads safely",