///
/// This is useful for initializing types which lazily allocate, like
/// `Vec::new` does.
+ // FIXME: rename to dangling() to match NonNull?
pub fn empty() -> Self {
unsafe {
let ptr = mem::align_of::<T>() as *mut T;
/// This is useful for initializing types which lazily allocate, like
/// `Vec::new` does.
#[stable(feature = "nonnull", since = "1.24.0")]
- pub fn empty() -> Self {
+ pub fn dangling() -> Self {
unsafe {
let ptr = mem::align_of::<T>() as *mut T;
NonNull::new_unchecked(ptr)