From bfbc89b5855822c6103c579ba72d5fba6fc0993e Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 26 Nov 2026 23:57:56 -0800 Subject: [PATCH] Runtime tests: the whole refills' pattern steps by as_chunks_mut, as clippy asks Clippy under --cfg m2v_gpu and --cfg m2v_cpu_icd refused chunks_exact_mut with a constant size in whole_copy_in.rs (check job m3-max-76207). The step is unchanged: each byte adds 37, eight at a time, the remainder one at a time. --- crates/metal2vulkan-runtime/src/tests/whole_copy_in.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/metal2vulkan-runtime/src/tests/whole_copy_in.rs b/crates/metal2vulkan-runtime/src/tests/whole_copy_in.rs index 937e51725..4b53ca001 100644 --- a/crates/metal2vulkan-runtime/src/tests/whole_copy_in.rs +++ b/crates/metal2vulkan-runtime/src/tests/whole_copy_in.rs @@ -143,13 +143,13 @@ fn pattern(x: u32, y: u32) -> u8 { fn advance(bytes: &mut [u8]) { const K: u64 = 0x2525_2525_2525_2525; const H: u64 = 0x8080_8080_8080_8080; - let mut chunks = bytes.chunks_exact_mut(8); - for chunk in &mut chunks { - let a = u64::from_ne_bytes((&*chunk).try_into().expect("eight bytes")); + let (chunks, rest) = bytes.as_chunks_mut::<8>(); + for chunk in chunks { + let a = u64::from_ne_bytes(*chunk); let sum = ((a & !H) + (K & !H)) ^ ((a ^ K) & H); - chunk.copy_from_slice(&sum.to_ne_bytes()); + *chunk = sum.to_ne_bytes(); } - for byte in chunks.into_remainder() { + for byte in rest { *byte = byte.wrapping_add(37); } }