fix(rust): satisfy layout assertions under clippy

Use usize::BITS for the byte offset that Clippy recognizes as a bit-width expression on both the static-CCtx and MT finish projections. Update the focused resource-failure test to provide the compression-job last-job argument required by the callback signature. This keeps the ABI checks architecture-independent while making all-target clippy compile the new tests.

Test Plan:

- ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings

- git diff --cached --check
This commit is contained in:
2026-07-20 16:14:10 +02:00
parent 5d91f86a34
commit 2b703ae2a1
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -2401,7 +2401,7 @@ const _: () = {
assert!(offset_of!(ZSTD_rust_initStaticCCtxState, reserve_object) == 5 * size_of::<usize>());
assert!(offset_of!(ZSTD_rust_initStaticCCtxState, zero) == 6 * size_of::<usize>());
assert!(offset_of!(ZSTD_rust_initStaticCCtxState, move_workspace) == 7 * size_of::<usize>());
assert!(offset_of!(ZSTD_rust_initStaticCCtxState, check_available) == 8 * size_of::<usize>());
assert!(offset_of!(ZSTD_rust_initStaticCCtxState, check_available) == usize::BITS as usize);
assert!(
offset_of!(ZSTD_rust_initStaticCCtxState, reserve_block_state) == 9 * size_of::<usize>()
);
+2 -2
View File
@@ -310,7 +310,7 @@ const _: () = {
offset_of!(ZSTDMT_compressionJobFinishProjection, publishConsumed)
== 7 * size_of::<usize>()
);
assert!(offset_of!(ZSTDMT_compressionJobFinishProjection, signal) == 8 * size_of::<usize>());
assert!(offset_of!(ZSTDMT_compressionJobFinishProjection, signal) == usize::BITS as usize);
assert!(size_of::<ZSTDMT_compressionJobFinishProjection>() == 9 * size_of::<usize>());
};
@@ -5487,7 +5487,7 @@ mod tests {
|| panic!("resource failure must skip context initialization"),
|| panic!("resource failure must skip sequence application"),
|| panic!("resource failure must skip frame-header writing"),
|| panic!("resource failure must skip compression"),
|_| panic!("resource failure must skip compression"),
|| panic!("resource failure must skip tracing"),
);