From bf339f38724e7784960c020f1566b09d1b574a51 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Sun, 19 Jul 2026 20:48:58 +0200 Subject: [PATCH] fix(mt): satisfy serial wait loop lint Use an explicit break-based loop for the Rust serial wait projection so Clippy recognizes that the C wait callback can change the shared job counter. The loop preserves the same lock ownership and condition-wait behavior. Test Plan: - cargo fmt --manifest-path rust/Cargo.toml -- --check - ulimit -v 41943040 && CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings --- rust/src/zstdmt_compress.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rust/src/zstdmt_compress.rs b/rust/src/zstdmt_compress.rs index 7fc871940..188741fe8 100644 --- a/rust/src/zstdmt_compress.rs +++ b/rust/src/zstdmt_compress.rs @@ -133,7 +133,10 @@ pub unsafe extern "C" fn ZSTDMT_rust_serialStateWaitForTurn( unsafe { lock(state.callback_context); - while *state.next_job_id < state.job_id { + loop { + if *state.next_job_id >= state.job_id { + break; + } wait(state.callback_context); } c_int::from(*state.next_job_id == state.job_id)