Constify Drop and Destruct

This commit is contained in:
Michael Goulet
2024-11-24 00:30:16 +00:00
parent 7db7489f9b
commit bd44b632a8
23 changed files with 130 additions and 692 deletions

View File

@@ -957,6 +957,7 @@ marker_impls! {
#[lang = "destruct"]
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
#[rustc_deny_explicit_impl(implement_via_object = false)]
#[cfg_attr(not(bootstrap), const_trait)]
pub trait Destruct {}
/// A marker for tuple types.

View File

@@ -203,7 +203,7 @@
/// [nomicon]: ../../nomicon/phantom-data.html#an-exception-the-special-case-of-the-standard-library-and-its-unstable-may_dangle
#[lang = "drop"]
#[stable(feature = "rust1", since = "1.0.0")]
// FIXME(const_trait_impl) #[const_trait]
#[cfg_attr(not(bootstrap), const_trait)]
pub trait Drop {
/// Executes the destructor for this type.
///