Skip to content

Commit 76b686f

Browse files
committed
Rename NonNull::empty to dangling.
1 parent 5aeeaff commit 76b686f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libcore/ptr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2370,6 +2370,7 @@ impl<T: Sized> Unique<T> {
23702370
///
23712371
/// This is useful for initializing types which lazily allocate, like
23722372
/// `Vec::new` does.
2373+
// FIXME: rename to dangling() to match NonNull?
23732374
pub fn empty() -> Self {
23742375
unsafe {
23752376
let ptr = mem::align_of::<T>() as *mut T;
@@ -2509,7 +2510,7 @@ impl<T: Sized> NonNull<T> {
25092510
/// This is useful for initializing types which lazily allocate, like
25102511
/// `Vec::new` does.
25112512
#[stable(feature = "nonnull", since = "1.24.0")]
2512-
pub fn empty() -> Self {
2513+
pub fn dangling() -> Self {
25132514
unsafe {
25142515
let ptr = mem::align_of::<T>() as *mut T;
25152516
NonNull::new_unchecked(ptr)

0 commit comments

Comments
 (0)