mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Add const_trait
to Allocator
This commit is contained in:
parent
f937a10c4e
commit
31f259ce5a
@ -107,6 +107,7 @@ impl fmt::Display for AllocError {
|
||||
///
|
||||
/// [*currently allocated*]: #currently-allocated-memory
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
#[const_trait]
|
||||
pub unsafe trait Allocator {
|
||||
/// Attempts to allocate a block of memory.
|
||||
///
|
||||
|
@ -140,6 +140,7 @@
|
||||
#![feature(const_str_from_utf8_unchecked_mut)]
|
||||
#![feature(const_swap)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(const_try)]
|
||||
#![feature(const_type_id)]
|
||||
#![feature(const_type_name)]
|
||||
#![feature(const_default_impls)]
|
||||
|
@ -71,6 +71,7 @@
|
||||
)]
|
||||
#[fundamental] // so that regex can rely that `&str: !FnMut`
|
||||
#[must_use = "closures are lazy and do nothing unless called"]
|
||||
#[cfg_attr(not(bootstrap), const_trait)]
|
||||
pub trait Fn<Args>: FnMut<Args> {
|
||||
/// Performs the call operation.
|
||||
#[unstable(feature = "fn_traits", issue = "29625")]
|
||||
@ -158,6 +159,7 @@ pub trait Fn<Args>: FnMut<Args> {
|
||||
)]
|
||||
#[fundamental] // so that regex can rely that `&str: !FnMut`
|
||||
#[must_use = "closures are lazy and do nothing unless called"]
|
||||
#[cfg_attr(not(bootstrap), const_trait)]
|
||||
pub trait FnMut<Args>: FnOnce<Args> {
|
||||
/// Performs the call operation.
|
||||
#[unstable(feature = "fn_traits", issue = "29625")]
|
||||
@ -237,6 +239,7 @@ pub trait FnMut<Args>: FnOnce<Args> {
|
||||
)]
|
||||
#[fundamental] // so that regex can rely that `&str: !FnMut`
|
||||
#[must_use = "closures are lazy and do nothing unless called"]
|
||||
#[cfg_attr(not(bootstrap), const_trait)]
|
||||
pub trait FnOnce<Args> {
|
||||
/// The returned type after the call operator is used.
|
||||
#[lang = "fn_once_output"]
|
||||
|
Loading…
Reference in New Issue
Block a user