fix(compress): make MT loop layout assertion lint-clean

The new MT-loop policy projection asserted its total size as eight times
`size_of::<usize>()`. Although that describes the padded C layout, clippy
interprets the multiplication as a manual bit-count expression and rejects it
under the repository's `-D warnings` policy.

Express the same ABI invariant from the final field offset plus its field size.
This keeps the assertion tied to the actual projected layout without changing
any runtime policy or C/Rust representation.

Test Plan:
- `git diff --cached --check` -- passed
- `rustfmt --edition 2021 --check rust/src/zstd_compress.rs` -- passed
- `ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings` -- passed
This commit is contained in:
2026-07-21 06:54:32 +02:00
parent 0faf3e4cf4
commit 14e3f7c140
+7 -1
View File
@@ -415,7 +415,13 @@ const _: () = {
output_pos_before output_pos_before
) == 7 * size_of::<usize>() ) == 7 * size_of::<usize>()
); );
assert!(size_of::<ZSTD_rust_compressStream2MTLoopPolicyState>() == 8 * size_of::<usize>()); assert!(
size_of::<ZSTD_rust_compressStream2MTLoopPolicyState>()
== offset_of!(
ZSTD_rust_compressStream2MTLoopPolicyState,
output_pos_before
) + size_of::<usize>()
);
}; };
#[inline] #[inline]