From a9e519db246f7578ad7a55f6575917b762b23fce Mon Sep 17 00:00:00 2001 From: ddidderr Date: Mon, 20 Jul 2026 03:34:23 +0200 Subject: [PATCH] fix(fileio): satisfy compression projection lint Keep the compression destination ABI assertion byte-accurate while expressing the final callback offset in the form required by current Clippy. The total projection size remains nine function-pointer slots. Test Plan: - cargo fmt --manifest-path rust/Cargo.toml --all -- --check - cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings - git diff --check --- rust/src/fileio_asyncio.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rust/src/fileio_asyncio.rs b/rust/src/fileio_asyncio.rs index e9f063f21..2656e5afe 100644 --- a/rust/src/fileio_asyncio.rs +++ b/rust/src/fileio_asyncio.rs @@ -400,9 +400,8 @@ pub struct FIO_rust_compress_dst_projection_t { pub remove_destination: Option, } const _: () = { - let callback_offset = (3 * size_of::() + 5 * size_of::() + size_of::() - - 1) - / size_of::() + let callback_offset = (3 * size_of::() + 5 * size_of::()) + .div_ceil(size_of::()) * size_of::(); assert!(std::mem::offset_of!(FIO_rust_compress_dst_projection_t, opaque) == 0); assert!( @@ -467,7 +466,7 @@ const _: () = { ); assert!( std::mem::offset_of!(FIO_rust_compress_dst_projection_t, remove_destination) - == callback_offset + 8 * size_of::() + == callback_offset + usize::BITS as usize ); assert!( size_of::() == callback_offset + 9 * size_of::()