move an assert!
to the right place
This commit is contained in:
parent
a7c45ec867
commit
d52ed8234e
1 changed files with 2 additions and 2 deletions
|
@ -1555,12 +1555,12 @@ impl<T: ?Sized> *mut T {
|
||||||
/// if offset < x.len() - 1 {
|
/// if offset < x.len() - 1 {
|
||||||
/// let u16_ptr = ptr.add(offset).cast::<u16>();
|
/// let u16_ptr = ptr.add(offset).cast::<u16>();
|
||||||
/// *u16_ptr = 0;
|
/// *u16_ptr = 0;
|
||||||
|
///
|
||||||
|
/// assert!(x == [0, 0, 7, 8, 9] || x == [5, 0, 0, 8, 9]);
|
||||||
/// } else {
|
/// } else {
|
||||||
/// // while the pointer can be aligned via `offset`, it would point
|
/// // while the pointer can be aligned via `offset`, it would point
|
||||||
/// // outside the allocation
|
/// // outside the allocation
|
||||||
/// }
|
/// }
|
||||||
///
|
|
||||||
/// assert!(x == [0, 0, 7, 8, 9] || x == [5, 0, 0, 8, 9]);
|
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "align_offset", since = "1.36.0")]
|
#[stable(feature = "align_offset", since = "1.36.0")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue