Skip to content

Commit 8174045

Browse files
committed
fix clippy
1 parent 2c545ed commit 8174045

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools/miri/src/shims/foreign_items.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,8 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
567567
);
568568
};
569569
let (_, addr) = ptr.into_parts(); // we know the offset is absolute
570-
if addr.bytes() % align.bytes() != 0 {
570+
// Cannot panic since `align` is a power of 2 and hence non-zero.
571+
if addr.bytes().checked_rem(align.bytes()).unwrap() != 0 {
571572
throw_unsup_format!(
572573
"`miri_promise_symbolic_alignment`: pointer is not actually aligned"
573574
);

0 commit comments

Comments
 (0)