diff options
| author | Ralf Jung <post@ralfj.de> | 2025-07-07 05:31:07 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-07 05:31:07 +0000 |
| commit | 51cba7839a62ccbc1afc0c0804175577013052ea (patch) | |
| tree | ddd6a21b5ea26dbb7814908658bface600f6fd20 /compiler/rustc_codegen_llvm/src | |
| parent | b2d8c81f7f1930f1a0d1a882c69322c9d7bb0545 (diff) | |
| parent | 0e043a86f06d32dc9dfb4cb993ae37dfbc7c23c6 (diff) | |
| download | rust-51cba7839a62ccbc1afc0c0804175577013052ea.tar.gz rust-51cba7839a62ccbc1afc0c0804175577013052ea.zip | |
Merge pull request #4449 from rust-lang/rustup-2025-07-07
Automatic Rustup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/abi.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/va_arg.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs index 4b07c8aef91..009e7e2487b 100644 --- a/compiler/rustc_codegen_llvm/src/abi.rs +++ b/compiler/rustc_codegen_llvm/src/abi.rs @@ -146,7 +146,7 @@ impl LlvmType for CastTarget { "total size {:?} cannot be divided into units of zero size", self.rest.total ); - if self.rest.total.bytes() % self.rest.unit.size.bytes() != 0 { + if !self.rest.total.bytes().is_multiple_of(self.rest.unit.size.bytes()) { assert_eq!(self.rest.unit.kind, RegKind::Integer, "only int regs can be split"); } self.rest.total.bytes().div_ceil(self.rest.unit.size.bytes()) diff --git a/compiler/rustc_codegen_llvm/src/va_arg.rs b/compiler/rustc_codegen_llvm/src/va_arg.rs index 4fe4c9bcbf2..486dc894a4e 100644 --- a/compiler/rustc_codegen_llvm/src/va_arg.rs +++ b/compiler/rustc_codegen_llvm/src/va_arg.rs @@ -172,10 +172,10 @@ fn emit_aapcs_va_arg<'ll, 'tcx>( let gr_type = target_ty.is_any_ptr() || target_ty.is_integral(); let (reg_off, reg_top, slot_size) = if gr_type { - let nreg = (layout.size.bytes() + 7) / 8; + let nreg = layout.size.bytes().div_ceil(8); (gr_offs, gr_top, nreg * 8) } else { - let nreg = (layout.size.bytes() + 15) / 16; + let nreg = layout.size.bytes().div_ceil(16); (vr_offs, vr_top, nreg * 16) }; |
