From 7f8df4f044897fc3a4d58a6b56abb06aae960400 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 23 Nov 2026 08:53:32 -0800 Subject: [PATCH] Player: compare-dumps's word walk reads each word through a function, not a closure 4027438d7d dropped the closure's copy of each word, and a closure that returns a slice of its argument does not name that lifetime, so the crate did not compile (m3-max-71456). The word is now read by a nested function whose signature ties the slice to the bytes. Verified: clippy and the dump tests in the job named in the lane's report; no local build. --- crates/metal2vulkan-validation/src/replay/dumps.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-validation/src/replay/dumps.rs b/crates/metal2vulkan-validation/src/replay/dumps.rs index 39bc79167..6aecf8421 100644 --- a/crates/metal2vulkan-validation/src/replay/dumps.rs +++ b/crates/metal2vulkan-validation/src/replay/dumps.rs @@ -274,11 +274,14 @@ pub(super) fn words(a: &[u8], b: &[u8], covered: &[(u64, u64)]) -> (u64, u64, Op if a == b { return (differing, under, first); } + /// The word of `bytes` at byte `at`: none past its end, fewer than 4 bytes at a short end. + fn side(bytes: &[u8], at: usize) -> Option<&[u8]> { + bytes.get(at..(at + 4).min(bytes.len())) + } let longest = a.len().max(b.len()).div_ceil(4); for word in 0..longest { let at = word * 4; - let side = |bytes: &[u8]| bytes.get(at..(at + 4).min(bytes.len())); - if side(a) == side(b) { + if side(a, at) == side(b, at) { continue; } differing += 1;