]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/ptr/non_null.rs
Auto merge of #103299 - nikic:usub-overflow, r=wesleywiser
[rust.git] / library / core / src / ptr / non_null.rs
index 7264d57ba6aed02a040518b404bd67d8d984bbb8..c18264d13ebac78993f8cbc9ab9090ed521fe0be 100644 (file)
@@ -197,7 +197,7 @@ impl<T: ?Sized> NonNull<T> {
     pub const unsafe fn new_unchecked(ptr: *mut T) -> Self {
         // SAFETY: the caller must guarantee that `ptr` is non-null.
         unsafe {
-            assert_unsafe_precondition!([T: ?Sized](ptr: *mut T) => !ptr.is_null());
+            assert_unsafe_precondition!("NonNull::new_unchecked requires that the pointer is non-null", [T: ?Sized](ptr: *mut T) => !ptr.is_null());
             NonNull { pointer: ptr as _ }
         }
     }