Skip to main content

AllocatorNightly

Trait AllocatorNightly 

Source
pub trait AllocatorNightly: Allocator { }
🔬This is a nightly-only experimental API. (allocator_ext #163177)
Expand description

Allocator marker trait that is only implemented stably for Global.

Enabling feature(allocator_ext) causes this trait to be implemented for all allocators in std, and for any downstream allocator that explicitly implements it.

This trait is used as a bound whenever a function constructing a type with an #[unstable] A: Allocator = Global parameter may be callable for A != Global.

This is to prevent stable code from e.g. constructing Arc<T, NotGlobal> using the From<Box<T, A>> for Arc<T, A> impl.

Note that this trait will be removed in the future, but downstream allocators should still feel free to implement it on nightly, to allow their allocator to be used with all unstable allocator APIs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl AllocatorNightly for Global

Source§

impl AllocatorNightly for System

This trait impl is unstable and only usable on nightly with feature(allocator_ext).

Source§

impl<A> AllocatorNightly for &A
where A: Allocator + ?Sized,

This trait impl is unstable and only usable on nightly with feature(allocator_ext).

Source§

impl<A> AllocatorNightly for &mut A
where A: Allocator + ?Sized,

This trait impl is unstable and only usable on nightly with feature(allocator_ext).

Source§

impl<P> AllocatorNightly for Pin<P>
where P: Deref + PinSafePointer, <P as Deref>::Target: Allocator,

This trait impl is unstable and only usable on nightly with feature(allocator_ext).

Source§

impl<T, A> AllocatorNightly for Arc<T, A>
where T: Allocator + ?Sized, A: Allocator,

This trait impl is unstable and only usable on nightly with feature(allocator_ext).

Source§

impl<T, A> AllocatorNightly for Box<T, A>
where T: Allocator + ?Sized, A: Allocator,

This trait impl is unstable and only usable on nightly with feature(allocator_ext).

Source§

impl<T, A> AllocatorNightly for Rc<T, A>
where T: Allocator + ?Sized, A: Allocator,

This trait impl is unstable and only usable on nightly with feature(allocator_ext).