Skip to content

Commit c1a7d5b

Browse files
dmytrostrukCopilot
andauthored
Fix unused variable warning on Windows in rust/build/in_process.rs (#2471)
The `executable: bool` parameter of `install_cached_file_path` is only read inside a `#[cfg(unix)]` block (used to chmod extracted binaries), so it is reported as unused on non-Unix targets. This fails downstream consumers building the crate from main with `RUSTFLAGS=-D warnings`. Add an explicit `#[cfg(not(unix))] let _ = executable;` to mark the parameter used on those targets, without changing Unix behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 1cc72da commit c1a7d5b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rust/build/in_process.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,12 @@ fn install_cached_file_path(
574574
bytes: &[u8],
575575
executable: bool,
576576
) {
577+
// `executable` only affects file permissions on Unix (see the `#[cfg(unix)]`
578+
// block below); explicitly mark it used elsewhere so non-Unix targets don't
579+
// warn about an unused parameter under `-D warnings`.
580+
#[cfg(not(unix))]
581+
let _ = executable;
582+
577583
assert!(
578584
!relative_path.is_absolute()
579585
&& !relative_path.components().any(|component| {

0 commit comments

Comments
 (0)