Skip to content

Commit

Permalink
move an assert! to the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin authored Aug 9, 2022
1 parent a7c45ec commit d52ed82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit d52ed82

Please sign in to comment.