about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/ptr/mut_ptr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index b8551eeed9e..bd2cadef774 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -1555,12 +1555,12 @@ impl<T: ?Sized> *mut T {
     /// if offset < x.len() - 1 {
     ///     let u16_ptr = ptr.add(offset).cast::<u16>();
     ///     *u16_ptr = 0;
+    ///
+    ///     assert!(x == [0, 0, 7, 8, 9] || x == [5, 0, 0, 8, 9]);
     /// } else {
     ///     // while the pointer can be aligned via `offset`, it would point
     ///     // outside the allocation
     /// }
-    ///
-    /// assert!(x == [0, 0, 7, 8, 9] || x == [5, 0, 0, 8, 9]);
     /// # }
     /// ```
     #[stable(feature = "align_offset", since = "1.36.0")]