#![no_std]
#![cfg_attr(not(feature = "nonnull_cast"), allow(unstable_name_collision))]
#[path = "libcore/alloc.rs"]
mod core_alloc;
#[path = "libstd/alloc.rs"]
mod std_alloc;
#[path = "liballoc/boxed.rs"]
pub mod boxed;
#[path = "liballoc/raw_vec.rs"]
pub mod raw_vec;
pub mod alloc {
pub use core_alloc::*;
pub use std_alloc::rust_oom as oom;
pub use std_alloc::{set_oom_hook, take_oom_hook};
}
pub use alloc::*;
pub use boxed::*;
pub use raw_vec::*;
#[cfg(not(feature = "nonnull_cast"))]
use core::ptr::NonNull;
#[cfg(not(feature = "nonnull_cast"))]
pub trait NonNullCast {
fn cast<U>(self) -> NonNull<U>;
}
#[cfg(not(feature = "nonnull_cast"))]
impl<T: ?Sized> NonNullCast for NonNull<T> {
fn cast<U>(self) -> NonNull<U> {
unsafe {
NonNull::new_unchecked(self.as_ptr() as *mut U)
}
}
}