readd const_trait
to Drop
, Destruct
, and Fn*
This commit is contained in:
parent
34097b2f33
commit
eac922e721
4 changed files with 6 additions and 0 deletions
|
@ -198,6 +198,7 @@
|
|||
#![feature(const_mut_refs)]
|
||||
#![feature(const_precise_live_drops)]
|
||||
#![feature(const_refs_to_cell)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(decl_macro)]
|
||||
#![feature(deprecated_suggestion)]
|
||||
#![feature(doc_cfg)]
|
||||
|
|
|
@ -858,6 +858,7 @@ impl<T: ?Sized> Unpin for *mut T {}
|
|||
#[lang = "destruct"]
|
||||
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
|
||||
#[rustc_deny_explicit_impl]
|
||||
#[const_trait]
|
||||
pub trait Destruct {}
|
||||
|
||||
/// A marker for tuple types.
|
||||
|
|
|
@ -134,6 +134,7 @@
|
|||
/// these types cannot have destructors.
|
||||
#[lang = "drop"]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[const_trait]
|
||||
pub trait Drop {
|
||||
/// Executes the destructor for this type.
|
||||
///
|
||||
|
|
|
@ -72,6 +72,7 @@ use crate::marker::Tuple;
|
|||
)]
|
||||
#[fundamental] // so that regex can rely that `&str: !FnMut`
|
||||
#[must_use = "closures are lazy and do nothing unless called"]
|
||||
#[const_trait]
|
||||
pub trait Fn<Args: Tuple>: FnMut<Args> {
|
||||
/// Performs the call operation.
|
||||
#[unstable(feature = "fn_traits", issue = "29625")]
|
||||
|
@ -158,6 +159,7 @@ pub trait Fn<Args: Tuple>: FnMut<Args> {
|
|||
)]
|
||||
#[fundamental] // so that regex can rely that `&str: !FnMut`
|
||||
#[must_use = "closures are lazy and do nothing unless called"]
|
||||
#[const_trait]
|
||||
pub trait FnMut<Args: Tuple>: FnOnce<Args> {
|
||||
/// Performs the call operation.
|
||||
#[unstable(feature = "fn_traits", issue = "29625")]
|
||||
|
@ -236,6 +238,7 @@ pub trait FnMut<Args: Tuple>: FnOnce<Args> {
|
|||
)]
|
||||
#[fundamental] // so that regex can rely that `&str: !FnMut`
|
||||
#[must_use = "closures are lazy and do nothing unless called"]
|
||||
#[const_trait]
|
||||
pub trait FnOnce<Args: Tuple> {
|
||||
/// The returned type after the call operator is used.
|
||||
#[lang = "fn_once_output"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue