about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-06 10:20:27 +0000
committerbors <bors@rust-lang.org>2025-07-06 10:20:27 +0000
commitc83e217d268d25960a0c79c6941bcb3917a6a0af (patch)
tree5fd07b0e7aacf90ba97a22a7254478e0a3b115b4 /compiler/rustc_const_eval/src
parente804cd4a5f1a5b658ddca245c80bef96a576c018 (diff)
parent097efc07cc13d8f6a3e04fe2a045b8a3ad6fd576 (diff)
downloadrust-c83e217d268d25960a0c79c6941bcb3917a6a0af.tar.gz
rust-c83e217d268d25960a0c79c6941bcb3917a6a0af.zip
Auto merge of #143521 - matthiaskrgr:rollup-kpv1og3, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#143416 (mbe: Defer checks for `compile_error!` until reporting an unused macro rule)
 - rust-lang/rust#143470 (std: sys: net: uefi: tcp4: Implement read)
 - rust-lang/rust#143477 (use `is_multiple_of` and `div_ceil`)
 - rust-lang/rust#143484 (distinguish the duplicate item of rpitit)
 - rust-lang/rust#143493 (tidy: use --bless for tidy spellcheck instead of spellcheck:fix)
 - rust-lang/rust#143504 (compiletest: print slightly more information on fs::write failure)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/interpret/memory.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs
index ff822b52a8d..c97d53a45de 100644
--- a/compiler/rustc_const_eval/src/interpret/memory.rs
+++ b/compiler/rustc_const_eval/src/interpret/memory.rs
@@ -537,7 +537,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
 
         #[inline]
         fn is_offset_misaligned(offset: u64, align: Align) -> Option<Misalignment> {
-            if offset % align.bytes() == 0 {
+            if offset.is_multiple_of(align.bytes()) {
                 None
             } else {
                 // The biggest power of two through which `offset` is divisible.
@@ -1554,7 +1554,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
                         // If the allocation is N-aligned, and the offset is not divisible by N,
                         // then `base + offset` has a non-zero remainder after division by `N`,
                         // which means `base + offset` cannot be null.
-                        if offset.bytes() % info.align.bytes() != 0 {
+                        if !offset.bytes().is_multiple_of(info.align.bytes()) {
                             return interp_ok(false);
                         }
                         // We don't know enough, this might be null.