Skip to content

Commit

Permalink
Update non_null.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhvani-Kapadia authored Oct 29, 2024
1 parent 17d509e commit 9b1cca6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1774,9 +1774,9 @@ impl<T: ?Sized> From<&mut T> for NonNull<T> {
#[inline]
fn from(reference: &mut T) -> Self {
// SAFETY: A mutable reference cannot be null.
unsafe { NonNull { pointer: reference as *mut T } }
unsafe { NonNull { pointer: reference as *mut T } }
}
}
}

#[stable(feature = "nonnull", since = "1.25.0")]
impl<T: ?Sized> From<&T> for NonNull<T> {
Expand All @@ -1786,7 +1786,7 @@ impl<T: ?Sized> From<&T> for NonNull<T> {
#[inline]
fn from(reference: &T) -> Self {
// SAFETY: A reference cannot be null.
unsafe { NonNull { pointer: reference as *const T } }
unsafe { NonNull { pointer: reference as *const T } }
}
}

Expand Down

0 comments on commit 9b1cca6

Please sign in to comment.