From b8e593228229cd91fcab6e74d235f5a3e0b0b73e Mon Sep 17 00:00:00 2001 From: ddidderr Date: Mon, 20 Jul 2026 13:48:52 +0200 Subject: [PATCH] fix(cli): document stdin callback safety contract The new direct Rust file-I/O callback is unsafe because it receives a raw NUL-terminated filename pointer. Add the required safety contract so CLI clippy with `-D warnings` accepts the migrated ABI leaf. Test Plan: - `git diff --cached --check` -- passed. - Capped CLI clippy rerun after this commit. --- rust/cli/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rust/cli/src/lib.rs b/rust/cli/src/lib.rs index 0a2631e39..0269c5a17 100644 --- a/rust/cli/src/lib.rs +++ b/rust/cli/src/lib.rs @@ -36,6 +36,11 @@ use std::ffi::c_void; use std::os::raw::{c_char, c_int}; /// Match the C `--list` stdin callback without crossing any file-I/O state. +/// +/// # Safety +/// +/// `file_name` must point to a valid NUL-terminated C string, as required by +/// the original C callback contract. `_opaque` is ignored. #[cfg(feature = "cli")] #[no_mangle] pub unsafe extern "C" fn FIO_listFileIsStdin(