Skip to content

Commit eac922e

Browse files
committed
readd const_trait to Drop, Destruct, and Fn*
1 parent 34097b2 commit eac922e

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

library/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
#![feature(const_mut_refs)]
199199
#![feature(const_precise_live_drops)]
200200
#![feature(const_refs_to_cell)]
201+
#![feature(const_trait_impl)]
201202
#![feature(decl_macro)]
202203
#![feature(deprecated_suggestion)]
203204
#![feature(doc_cfg)]

library/core/src/marker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ impl<T: ?Sized> Unpin for *mut T {}
858858
#[lang = "destruct"]
859859
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
860860
#[rustc_deny_explicit_impl]
861+
#[const_trait]
861862
pub trait Destruct {}
862863

863864
/// A marker for tuple types.

library/core/src/ops/drop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
/// these types cannot have destructors.
135135
#[lang = "drop"]
136136
#[stable(feature = "rust1", since = "1.0.0")]
137+
#[const_trait]
137138
pub trait Drop {
138139
/// Executes the destructor for this type.
139140
///

library/core/src/ops/function.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ use crate::marker::Tuple;
7272
)]
7373
#[fundamental] // so that regex can rely that `&str: !FnMut`
7474
#[must_use = "closures are lazy and do nothing unless called"]
75+
#[const_trait]
7576
pub trait Fn<Args: Tuple>: FnMut<Args> {
7677
/// Performs the call operation.
7778
#[unstable(feature = "fn_traits", issue = "29625")]
@@ -158,6 +159,7 @@ pub trait Fn<Args: Tuple>: FnMut<Args> {
158159
)]
159160
#[fundamental] // so that regex can rely that `&str: !FnMut`
160161
#[must_use = "closures are lazy and do nothing unless called"]
162+
#[const_trait]
161163
pub trait FnMut<Args: Tuple>: FnOnce<Args> {
162164
/// Performs the call operation.
163165
#[unstable(feature = "fn_traits", issue = "29625")]
@@ -236,6 +238,7 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
236238
)]
237239
#[fundamental] // so that regex can rely that `&str: !FnMut`
238240
#[must_use = "closures are lazy and do nothing unless called"]
241+
#[const_trait]
239242
pub trait FnOnce<Args: Tuple> {
240243
/// The returned type after the call operator is used.
241244
#[lang = "fn_once_output"]

0 commit comments

Comments
 (0)