Skip to content

fix(lint): gate Executor::owns_process_image accessor on #[cfg(unix)] (Refs #4206, #4211) - #4258

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/4211-owns-process-image-cfg-unix
Nov 28, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/4211-owns-process-image-cfg-unix

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

Gate Executor::owns_process_image(&self) (src/executor/public_accessors.rs:2368, introduced in #4246) with #[cfg(unix)] so Windows RUSTFLAGS="-D warnings" cargo check --lib --locked passes with zero warnings (Refs #4206, #4211).

Root Cause

Every call site of the .owns_process_image() method lives inside Unix-only gates:

  • src/script_driver.rs:9494-9503 (#[cfg(unix)])
  • src/script_driver.rs:9549-9565 (#[cfg(all(test, unix))])

All other references across src/executor/ read the struct field self.owns_process_image directly, so the pub(crate) method was dead code on Windows builds.

What this PR deletes

  • Eliminates the Windows dead_code warning on Executor::owns_process_image without adding any #[allow(dead_code)] attribute.

Verification

  • Windows: RUSTFLAGS="-D warnings" cargo check --lib --locked — 0 warnings, exit 0.
  • python scripts/check-rustfmt.py — ok (225 targets).
  • python scripts/check-api-ledger.py — OK (298 symbols).

Refs #4206, #4211

@caomengxuan666
caomengxuan666 merged commit 8407b40 into master Nov 28, 2026
11 of 13 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/4211-owns-process-image-cfg-unix branch November 28, 2026 02:44
caomengxuan666 added a commit that referenced this pull request Nov 28, 2026
)

track_cell and stale_names are consumed only by the debug_assertions
boundary verifier in executor/variable_state.rs (plus var_table unit
tests for track_cell). In a release-profile lib build both are dead
code, which turns niubash CI red: it builds the vendored rubash in
release with -D warnings. Gate each method on its consumers cfg,
mirroring #4258: track_cell on any(debug_assertions, test),
stale_names on debug_assertions. No behavior change: in release the
tracked set is always empty already.
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.

1 participant