Skip to content

Commit a844700

Browse files
Update non_null.rs
1 parent 0116189 commit a844700

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/core/src/ptr/non_null.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,8 +1774,9 @@ impl<T: ?Sized> From<&mut T> for NonNull<T> {
17741774
#[inline]
17751775
fn from(reference: &mut T) -> Self {
17761776
// SAFETY: A mutable reference cannot be null.
1777-
unsafe { NonNull { pointer: reference as *mut T } }
1778-
}
1777+
unsafe { NonNull { pointer: reference as *mut T }
1778+
}
1779+
}
17791780

17801781
#[stable(feature = "nonnull", since = "1.25.0")]
17811782
impl<T: ?Sized> From<&T> for NonNull<T> {

0 commit comments

Comments
 (0)