]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/ptr/const_ptr.rs
Rollup merge of #103616 - rust-lang:notriddle/moz-box-sizing, r=GuillaumeGomez
[rust.git] / library / core / src / ptr / const_ptr.rs
index 67e59460d74b0e3d293652a62a8a48e9bf03eb52..5a083227bb0efda119a32a6458b3d129affaace6 100644 (file)
@@ -761,7 +761,10 @@ pub fn mask(self, mask: usize) -> *const T {
         // SAFETY: The comparison has no side-effects, and the intrinsic
         // does this check internally in the CTFE implementation.
         unsafe {
-            assert_unsafe_precondition!([T](this: *const T, origin: *const T) => this >= origin)
+            assert_unsafe_precondition!(
+                "ptr::sub_ptr requires `this >= origin`",
+                [T](this: *const T, origin: *const T) => this >= origin
+            )
         };
 
         let pointee_size = mem::size_of::<T>();
@@ -802,7 +805,7 @@ pub const fn guaranteed_eq(self, other: *const T) -> Option<bool>
 
     /// Returns whether two pointers are guaranteed to be inequal.
     ///
-    /// At runtime this function behaves like `Some(self == other)`.
+    /// At runtime this function behaves like `Some(self != other)`.
     /// However, in some contexts (e.g., compile-time evaluation),
     /// it is not always possible to determine inequality of two pointers, so this function may
     /// spuriously return `None` for pointers that later actually turn out to have its inequality known.