Skip to content

Commit d52ed82

Browse files
authored
move an assert! to the right place
1 parent a7c45ec commit d52ed82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/ptr/mut_ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1555,12 +1555,12 @@ impl<T: ?Sized> *mut T {
15551555
/// if offset < x.len() - 1 {
15561556
/// let u16_ptr = ptr.add(offset).cast::<u16>();
15571557
/// *u16_ptr = 0;
1558+
///
1559+
/// assert!(x == [0, 0, 7, 8, 9] || x == [5, 0, 0, 8, 9]);
15581560
/// } else {
15591561
/// // while the pointer can be aligned via `offset`, it would point
15601562
/// // outside the allocation
15611563
/// }
1562-
///
1563-
/// assert!(x == [0, 0, 7, 8, 9] || x == [5, 0, 0, 8, 9]);
15641564
/// # }
15651565
/// ```
15661566
#[stable(feature = "align_offset", since = "1.36.0")]

0 commit comments

Comments
 (0)