Use pointer::is_aligned
in ThinBox debug assert
This commit is contained in:
parent
fc109bb6c6
commit
25164b4e51
@ -224,7 +224,7 @@ impl<H> WithHeader<H> {
|
||||
// will always result in an aligned header pointer, it just may not point to the
|
||||
// beginning of the allocation.
|
||||
let hp = unsafe { self.0.as_ptr().sub(Self::header_size()) as *mut H };
|
||||
debug_assert!((hp.addr() & (core::mem::align_of::<H>() - 1)) == 0);
|
||||
debug_assert!(hp.is_aligned());
|
||||
hp
|
||||
}
|
||||
|
||||
|
@ -168,6 +168,7 @@
|
||||
#![feature(nll)] // Not necessary, but here to test the `nll` feature.
|
||||
#![feature(rustc_allow_const_fn_unstable)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![feature(pointer_is_aligned)]
|
||||
#![feature(slice_internals)]
|
||||
#![feature(staged_api)]
|
||||
#![cfg_attr(test, feature(test))]
|
||||
|
Loading…
x
Reference in New Issue
Block a user