Skip to content

Commit 801deae

Browse files
authored
Rollup merge of #49473 - joshtriplett:nonnull-size, r=steveklabnik
src/libcore/ptr.rs: Fix documentation for size of `Option<NonNull<T>>` Seems more useful to say that it has the same size as `*mut T`.
2 parents dd5f17a + 39fe29b commit 801deae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,7 @@ impl<'a, T: ?Sized> From<NonNull<T>> for Unique<T> {
26532653
///
26542654
/// Unlike `*mut T`, the pointer must always be non-null, even if the pointer
26552655
/// is never dereferenced. This is so that enums may use this forbidden value
2656-
/// as a discriminant -- `Option<NonNull<T>>` has the same size as `NonNull<T>`.
2656+
/// as a discriminant -- `Option<NonNull<T>>` has the same size as `*mut T`.
26572657
/// However the pointer may still dangle if it isn't dereferenced.
26582658
///
26592659
/// Unlike `*mut T`, `NonNull<T>` is covariant over `T`. If this is incorrect

0 commit comments

Comments
 (0)