Implement ptr.is_aligned()
in terms of .is_aligned_to()
This commit is contained in:
parent
a908eec438
commit
6c1ebff59e
@ -1301,7 +1301,7 @@ impl<T: ?Sized> *const T {
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
self.addr() % core::mem::align_of::<T>() == 0
|
||||
self.is_aligned_to(core::mem::align_of::<T>())
|
||||
}
|
||||
|
||||
/// Returns whether the pointer is aligned to `align`.
|
||||
|
@ -1570,7 +1570,7 @@ impl<T: ?Sized> *mut T {
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
self.addr() % core::mem::align_of::<T>() == 0
|
||||
self.is_aligned_to(core::mem::align_of::<T>())
|
||||
}
|
||||
|
||||
/// Returns whether the pointer is aligned to `align`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user