We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
ptr.is_aligned()
.is_aligned_to()
1 parent a908eec commit 6c1ebffCopy full SHA for 6c1ebff
library/core/src/ptr/const_ptr.rs
@@ -1301,7 +1301,7 @@ impl<T: ?Sized> *const T {
1301
where
1302
T: Sized,
1303
{
1304
- self.addr() % core::mem::align_of::<T>() == 0
+ self.is_aligned_to(core::mem::align_of::<T>())
1305
}
1306
1307
/// Returns whether the pointer is aligned to `align`.
library/core/src/ptr/mut_ptr.rs
@@ -1570,7 +1570,7 @@ impl<T: ?Sized> *mut T {
1570
1571
1572
1573
1574
1575
1576
0 commit comments