Skip to content

Fix Windows unused-variable warning in rust/build/in_process.rs - #2471

Merged
SteveSandersonMS merged 1 commit into
mainfrom
dmytrostruk-super-umbrella
Sep 2, 2026
Merged

Fix Windows unused-variable warning in rust/build/in_process.rs#2471
SteveSandersonMS merged 1 commit into
mainfrom
dmytrostruk-super-umbrella

Conversation

@dmytrostruk

Copy link
Copy Markdown
Contributor

Problem

install_cached_file_path in rust/build/in_process.rs takes an executable: bool parameter that is only read inside a #[cfg(unix)] block (used to chmod extracted binaries). On non-Unix targets the parameter is therefore reported as unused, which fails downstream consumers compiling this crate directly from main with RUSTFLAGS=-D warnings.

Fix

Add an explicit #[cfg(not(unix))] let _ = executable; inside the function so the parameter is marked used on non-Unix targets, without changing any Unix behavior (the chmod logic under #[cfg(unix)] is untouched).

Validation

  • cargo fmt -- --check — clean
  • RUSTFLAGS=-D warnings cargo check --all-targets and cargo clippy --all-targets -- -D warnings — clean on the host
  • Reproduced and verified the fix directly: compiled the affected function signature with rustc --target x86_64-pc-windows-msvc --crate-type lib -D warnings — this fails with error: unused variable: 'executable' before the fix and compiles cleanly after it (also re-verified clean on a Unix target to confirm no regression to the chmod path).

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

Copilot AI balanced review requested due to automatic review settings September 2, 2026 02:27
@dmytrostruk
dmytrostruk requested a review from a team as a code owner September 2, 2026 02:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The targeted change correctly resolves the warning without affecting runtime behavior.

Review tier: Balanced
Findings: None

What changed in this PR

Prevents non-Unix Rust builds from failing under -D warnings.

Changes:

  • Marks the Unix-only executable parameter as used on non-Unix targets.
  • Preserves existing Unix permission behavior.
File Description
rust/​build/​in_process.rs Adds a conditional no-op use of executable.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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>
@SteveSandersonMS
SteveSandersonMS force-pushed the dmytrostruk-super-umbrella branch from a4a177f to 11c6db9 Compare September 2, 2026 12:22

@roji roji left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we run Clippy and rustfmt on Linux only (apparently for perf/simplicity).

@roji
roji added this pull request to the merge queue Sep 2, 2026
@SteveSandersonMS
SteveSandersonMS removed this pull request from the merge queue due to a manual request Sep 2, 2026
@SteveSandersonMS
SteveSandersonMS merged commit c1a7d5b into main Sep 2, 2026
33 checks passed
@SteveSandersonMS
SteveSandersonMS deleted the dmytrostruk-super-umbrella branch September 2, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants