]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/ptr/const_ptr.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / libcore / ptr / const_ptr.rs
index fc3c02e1f066df2573de4a3bdd8385b5cc4d9cff..a540016854df3b7b5d127558dc856e9d75313665 100644 (file)
@@ -53,7 +53,7 @@ pub const fn cast<U>(self) -> *const U {
     /// all of the following is true:
     /// - it is properly aligned
     /// - it must point to an initialized instance of T; in particular, the pointer must be
-    ///   "dereferencable" in the sense defined [here].
+    ///   "dereferenceable" in the sense defined [here].
     ///
     /// This applies even if the result of this method is unused!
     /// (The part about being initialized is not yet fully decided, but until
@@ -183,7 +183,7 @@ pub unsafe fn offset(self, count: isize) -> *const T
     /// within the same allocated object: [`offset`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_offset` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`offset`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
@@ -480,7 +480,7 @@ pub unsafe fn sub(self, count: usize) -> Self
     /// within the same allocated object: [`add`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_add` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`add`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.
@@ -535,7 +535,7 @@ pub fn wrapping_add(self, count: usize) -> Self
     /// within the same allocated object: [`sub`] is immediate Undefined Behavior when
     /// crossing object boundaries; `wrapping_sub` produces a pointer but still leads
     /// to Undefined Behavior if that pointer is dereferenced. [`sub`] can be optimized
-    /// better and is thus preferrable in performance-sensitive code.
+    /// better and is thus preferable in performance-sensitive code.
     ///
     /// If you need to cross object boundaries, cast the pointer to an integer and
     /// do the arithmetic there.