Skip to content

Commit 4df2a28

Browse files
committed
Add Destructible for replacing ~const Drop
1 parent 051d117 commit 4df2a28

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

compiler/rustc_hir/src/lang_items.rs

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ language_item_table! {
216216
Freeze, sym::freeze, freeze_trait, Target::Trait, GenericRequirement::Exact(0);
217217

218218
Drop, sym::drop, drop_trait, Target::Trait, GenericRequirement::None;
219+
Destructible, sym::destructible, destructible_trait, Target::Trait, GenericRequirement::None;
219220

220221
CoerceUnsized, sym::coerce_unsized, coerce_unsized_trait, Target::Trait, GenericRequirement::Minimum(1);
221222
DispatchFromDyn, sym::dispatch_from_dyn, dispatch_from_dyn_trait, Target::Trait, GenericRequirement::Minimum(1);

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ symbols! {
571571
deref_target,
572572
derive,
573573
derive_default_enum,
574+
destructible,
574575
destructuring_assignment,
575576
diagnostic,
576577
direct,

library/core/src/marker.rs

+7
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,13 @@ impl<T: ?Sized> Unpin for *const T {}
792792
#[stable(feature = "pin_raw", since = "1.38.0")]
793793
impl<T: ?Sized> Unpin for *mut T {}
794794

795+
/// A marker for types that can be dropped.
796+
///
797+
/// The compiler logic for this trait is currently unimplemented.
798+
#[unstable(feature = "const_trait_impl", issue = "67792")]
799+
#[cfg_attr(not(bootstrap), lang = "destructible")]
800+
pub trait Destructible {}
801+
795802
/// Implementations of `Copy` for primitive types.
796803
///
797804
/// Implementations that cannot be described in Rust

0 commit comments

Comments
 (0)