Skip to content

Commit 3e569dd

Browse files
committed
Remove lang items Send, UnwindSafe and RefUnwindSafe
1 parent 6e0b554 commit 3e569dd

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

compiler/rustc_hir/src/lang_items.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,4 @@ language_item_table! {
348348
Range, sym::Range, range_struct, Target::Struct;
349349
RangeToInclusive, sym::RangeToInclusive, range_to_inclusive_struct, Target::Struct;
350350
RangeTo, sym::RangeTo, range_to_struct, Target::Struct;
351-
Send, sym::send, send_trait, Target::Trait;
352-
UnwindSafe, sym::unwind_safe, unwind_safe_trait, Target::Trait;
353-
RefUnwindSafe, sym::ref_unwind_safe, ref_unwind_safe_trait, Target::Trait;
354351
}

compiler/rustc_passes/src/lang_items.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,6 @@ impl LanguageItemCollector<'tcx> {
257257
| LangItem::Unpin
258258
| LangItem::Termination
259259
| LangItem::Try
260-
| LangItem::Send
261-
| LangItem::UnwindSafe
262-
| LangItem::RefUnwindSafe
263260
=> Some(0),
264261

265262
// Not a trait

compiler/rustc_span/src/symbol.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ symbols! {
947947
receiver,
948948
recursion_limit,
949949
reexport_test_harness_main,
950-
ref_unwind_safe,
950+
ref_unwind_safe_trait,
951951
reference,
952952
reflect,
953953
reg,
@@ -1073,7 +1073,6 @@ symbols! {
10731073
self_in_typedefs,
10741074
self_struct_ctor,
10751075
semitransparent,
1076-
send,
10771076
send_trait,
10781077
shl,
10791078
shl_assign,
@@ -1299,7 +1298,7 @@ symbols! {
12991298
unused_qualifications,
13001299
unwind,
13011300
unwind_attributes,
1302-
unwind_safe,
1301+
unwind_safe_trait,
13031302
unwrap,
13041303
unwrap_or,
13051304
use_extern_macros,

library/core/src/marker.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ 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+
<<<<<<< HEAD
3435
#[lang = "send"]
36+
=======
37+
>>>>>>> Remove lang items Send, UnwindSafe and RefUnwindSafe
3538
#[rustc_on_unimplemented(
3639
message = "`{Self}` cannot be sent between threads safely",
3740
label = "`{Self}` cannot be sent between threads safely"

library/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+
#[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+
#[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)