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