safe_allocator_api/
prelude.rs

1//! Prelude module for allocator API types.
2//!
3//! This module centralizes the conditional imports for allocator-related types,
4//! allowing the rest of the crate to use consistent types regardless of whether
5//! the nightly feature is enabled or not.
6
7#[cfg(not(feature = "nightly"))]
8pub use allocator_api2::alloc::Allocator;
9#[cfg(feature = "nightly")]
10pub use std::alloc::Allocator;
11
12#[cfg(not(feature = "nightly"))]
13pub use allocator_api2::alloc::Layout;
14#[cfg(feature = "nightly")]
15pub use core::alloc::Layout;
16
17#[cfg(not(feature = "nightly"))]
18pub use allocator_api2::alloc::AllocError;
19#[cfg(feature = "nightly")]
20pub use std::alloc::AllocError;
21
22#[cfg(not(feature = "nightly"))]
23pub use allocator_api2::alloc::Global;
24#[cfg(feature = "nightly")]
25pub use std::alloc::Global;