diff --git a/crates/cust/src/memory/device/device_buffer.rs b/crates/cust/src/memory/device/device_buffer.rs index 706b058c..eae9fb4b 100644 --- a/crates/cust/src/memory/device/device_buffer.rs +++ b/crates/cust/src/memory/device/device_buffer.rs @@ -320,7 +320,8 @@ impl DeviceBuffer { /// - If either type is a ZST (but not both). #[cfg_attr(docsrs, doc(cfg(feature = "bytemuck")))] pub fn try_cast(self) -> Result, PodCastError> { - if align_of::() > align_of::() && (self.buf.as_raw() as usize) % align_of::() != 0 + if align_of::() > align_of::() + && !(self.buf.as_raw() as usize).is_multiple_of(align_of::()) { Err(PodCastError::TargetAlignmentGreaterAndInputNotAligned) } else if size_of::() == size_of::() { @@ -328,7 +329,7 @@ impl DeviceBuffer { Ok(unsafe { transmute::, DeviceBuffer>(self) }) } else if size_of::() == 0 || size_of::() == 0 { Err(PodCastError::SizeMismatch) - } else if (size_of::() * self.len) % size_of::() == 0 { + } else if (size_of::() * self.len).is_multiple_of(size_of::()) { let new_len = (size_of::() * self.len) / size_of::(); let ret = Ok(DeviceBuffer { buf: self.buf.cast(), diff --git a/crates/rustc_codegen_nvvm/src/abi.rs b/crates/rustc_codegen_nvvm/src/abi.rs index eca12b21..60147222 100644 --- a/crates/rustc_codegen_nvvm/src/abi.rs +++ b/crates/rustc_codegen_nvvm/src/abi.rs @@ -207,7 +207,12 @@ 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, diff --git a/crates/rustc_codegen_nvvm/src/builder.rs b/crates/rustc_codegen_nvvm/src/builder.rs index bee8d182..f0c402e1 100644 --- a/crates/rustc_codegen_nvvm/src/builder.rs +++ b/crates/rustc_codegen_nvvm/src/builder.rs @@ -1056,7 +1056,7 @@ impl<'ll, 'tcx, 'a> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { todo!() } - fn filter_landing_pad(&mut self, _pers_fn: &'ll Value) -> (&'ll Value, &'ll Value) { + fn filter_landing_pad(&mut self, _pers_fn: &'ll Value) { todo!() } diff --git a/crates/rustc_codegen_nvvm/src/int_replace.rs b/crates/rustc_codegen_nvvm/src/int_replace.rs index 7b6288eb..dcb584b5 100644 --- a/crates/rustc_codegen_nvvm/src/int_replace.rs +++ b/crates/rustc_codegen_nvvm/src/int_replace.rs @@ -77,7 +77,7 @@ pub(crate) fn get_transformed_type<'ll>( // going from i64 down. pub(crate) fn target_vector_width_and_count(int_width: u32) -> (u32, u32) { for &i in WIDTH_CANDIDATES { - if int_width % i == 0 { + if int_width.is_multiple_of(i) { return (i, int_width / i); } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 858caf73..fc048980 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-06-23" -components = ["clippy", "llvm-tools-preview", "rust-src", "rustc-dev", "rustfmt", "rust-analyzer"] \ No newline at end of file +channel = "nightly-2025-06-30" +components = ["clippy", "llvm-tools-preview", "rust-src", "rustc-dev", "rustfmt", "rust-analyzer"]