Skip to content

Commit 11012b0

Browse files
Rollup merge of rust-lang#86726 - sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis
Use diagnostic items instead of lang items for rfc2229 migrations This PR removes the `Send`, `UnwindSafe` and `RefUnwindSafe` lang items introduced in rust-lang#84730, and uses diagnostic items instead to check for `Send`, `UnwindSafe` and `RefUnwindSafe` traits for RFC2229 migrations. r? ```@nikomatsakis```
2 parents 378c6a9 + 3f81861 commit 11012b0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

core/src/marker.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use crate::hash::Hasher;
3131
/// [ub]: ../../reference/behavior-considered-undefined.html
3232
#[stable(feature = "rust1", since = "1.0.0")]
3333
#[cfg_attr(not(test), rustc_diagnostic_item = "send_trait")]
34-
#[lang = "send"]
3534
#[rustc_on_unimplemented(
3635
message = "`{Self}` cannot be sent between threads safely",
3736
label = "`{Self}` cannot be sent between threads safely"

std/src/panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn panic_any<M: 'static + Any + Send>(msg: M) -> ! {
133133
/// [`AssertUnwindSafe`] wrapper struct can be used to force this trait to be
134134
/// implemented for any closed over variables passed to `catch_unwind`.
135135
#[stable(feature = "catch_unwind", since = "1.9.0")]
136-
#[cfg_attr(not(test), lang = "unwind_safe")]
136+
#[cfg_attr(not(test), rustc_diagnostic_item = "unwind_safe_trait")]
137137
#[rustc_on_unimplemented(
138138
message = "the type `{Self}` may not be safely transferred across an unwind boundary",
139139
label = "`{Self}` may not be safely transferred across an unwind boundary"
@@ -149,7 +149,7 @@ pub auto trait UnwindSafe {}
149149
/// This is a "helper marker trait" used to provide impl blocks for the
150150
/// [`UnwindSafe`] trait, for more information see that documentation.
151151
#[stable(feature = "catch_unwind", since = "1.9.0")]
152-
#[cfg_attr(not(test), lang = "ref_unwind_safe")]
152+
#[cfg_attr(not(test), rustc_diagnostic_item = "ref_unwind_safe_trait")]
153153
#[rustc_on_unimplemented(
154154
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
155155
transferrable across a catch_unwind boundary",

0 commit comments

Comments
 (0)