about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2022-03-13 15:04:01 +1100
committerDeadbeef <ent3rm4n@gmail.com>2022-03-21 17:04:02 +1100
commit4df2a28aee55f73d4e898c931664b8087b06522d (patch)
tree11e3e8026e59af560333141f625b2c27328200cb
parent051d1176b786aadd7d7c048f822cb6bfab00fe03 (diff)
downloadrust-4df2a28aee55f73d4e898c931664b8087b06522d.tar.gz
rust-4df2a28aee55f73d4e898c931664b8087b06522d.zip
Add `Destructible` for replacing `~const Drop`
-rw-r--r--compiler/rustc_hir/src/lang_items.rs1
-rw-r--r--compiler/rustc_span/src/symbol.rs1
-rw-r--r--library/core/src/marker.rs7
3 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs
index b299e71c9c4..05944dd22bd 100644
--- a/compiler/rustc_hir/src/lang_items.rs
+++ b/compiler/rustc_hir/src/lang_items.rs
@@ -216,6 +216,7 @@ language_item_table! {
     Freeze,                  sym::freeze,              freeze_trait,               Target::Trait,          GenericRequirement::Exact(0);
 
     Drop,                    sym::drop,                drop_trait,                 Target::Trait,          GenericRequirement::None;
+    Destructible,            sym::destructible,        destructible_trait,         Target::Trait,          GenericRequirement::None;
 
     CoerceUnsized,           sym::coerce_unsized,      coerce_unsized_trait,       Target::Trait,          GenericRequirement::Minimum(1);
     DispatchFromDyn,         sym::dispatch_from_dyn,   dispatch_from_dyn_trait,    Target::Trait,          GenericRequirement::Minimum(1);
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 523a1066a1c..c07cd86b4e2 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -571,6 +571,7 @@ symbols! {
         deref_target,
         derive,
         derive_default_enum,
+        destructible,
         destructuring_assignment,
         diagnostic,
         direct,
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index 82bac2640b4..44d388fb7a3 100644
--- a/library/core/src/marker.rs
+++ b/library/core/src/marker.rs
@@ -792,6 +792,13 @@ impl<T: ?Sized> Unpin for *const T {}
 #[stable(feature = "pin_raw", since = "1.38.0")]
 impl<T: ?Sized> Unpin for *mut T {}
 
+/// A marker for types that can be dropped.
+///
+/// The compiler logic for this trait is currently unimplemented.
+#[unstable(feature = "const_trait_impl", issue = "67792")]
+#[cfg_attr(not(bootstrap), lang = "destructible")]
+pub trait Destructible {}
+
 /// Implementations of `Copy` for primitive types.
 ///
 /// Implementations that cannot be described in Rust