Skip to content

WIP: clear pre-existing all-targets dead_code warning in issue1941_1948 pin file - #2079

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/alltargets-deadcode-status-field
Oct 29, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/alltargets-deadcode-status-field

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

What this is

Clears a pre-existing cargo check --all-targets warning on master — not a regression introduced by any in-flight work. The fix-2071 cluster re-verified the identical red on a pristine master checkout; this PR removes it.

The warning

warning: field `status` is never read
  --> tests/issue1941_1948_sim_layer_option_regressions.rs:43:5

The pin file (merged in PR #2018) defines a probe record

struct Output {
    status: i32,
    stdout: String,
    stderr: String,
}

and never reads status. That is by construction: status is the exit status of the whole outer rubash -c script (its last command), not of the applet under test. Each applet's exit code is already pinned through the in-script rc=$? echoes captured in stdout, so asserting this field would pin the wrong quantity.

Disposition

Field-level #[allow(dead_code)] with the reason recorded at the field — the same pattern this repo already uses for probe-record fields kept for debugging (tests/issue383_posix_roundtrip_stickiness.rs). The field stays available for probe debugging; no pin is removed and no expectation changes.

Diff: one test file, +6/−1 (five comment lines + the attribute; the −1 is a trailing blank line at EOF normalized by per-file rustfmt). Zero behavior change; no product code touched.

Whole-surface census

Baseline cargo check --all-targets on master 32e67c5a was run before the fix: this was the only warning in the entire all-targets surface. Nothing else needed the same treatment.

Gates (local — this surface is CI-uncovered)

rubash CI does not run an all-targets check, and niubash CI's -D warnings reaches only the lib surface, so these local runs are the terminal gate:

  • cargo check --all-targets → clean, zero warnings
  • RUSTFLAGS="-D warnings" cargo check --all-targets → clean (full recheck)
  • cargo test --test issue1941_1948_sim_layer_option_regressions → 19 passed / 0 failed (the 20th row is the Windows-gated mkfifo pin, not compiled on Linux)

…tput::status

tests/issue1941_1948_sim_layer_option_regressions.rs (the #1941-#1948
pin file merged in PR #2018) records the outer rubash -c process
status in its probe Output struct but never asserts it: each applet's
exit code is pinned through the in-script rc=$? echoes in stdout,
while this field is the exit status of the whole script (its last
command), not of the applet under test. cargo check --all-targets
therefore reports dead_code (field status is never read), which is a
hard failure under the -D warnings discipline.

Disposition follows the existing repo precedent for probe-record
fields kept for debugging (tests/issue383_posix_roundtrip_stickiness.rs):
a field-level #[allow(dead_code)] with the reason recorded at the
field. No pin removed, no expectation changed, no product code
touched; the trailing blank line at EOF is normalized by rustfmt.

Verified on master 32e67c5: baseline cargo check --all-targets
showed this as the ONLY warning in the whole all-targets surface;
after the fix both cargo check --all-targets and
RUSTFLAGS=-D warnings cargo check --all-targets are clean, and the
pin target runs 19 passed / 0 failed (the 20th row is Windows-gated).
caomengxuan666 added a commit that referenced this pull request Oct 29, 2026
New battery tests/issue2036_s4_projection_regressions.rs pinning
the projected faces' current behavior, measured on the
post-projection tree:

- stage arms (grep/head/wc/tr/sed/trap -p), true/false status,
  the pre-check's 127 decline, the sequential-route cat arm
  replacing while the planner yields (the registered per-face
  rule), the yes stand-in;
- timed models: consumer timeout 142, producer+consumer+followup
  chain, bare-read model engagement;
- comsub word arms (echo/printf/cat + its stand-down
  decline-to-127, basename/umask/pwd/type/kill/ulimit), the
  mktemp arm answering for an unresolvable name (its registered
  per-face rule), the exact-body True/Colon/False slots;
- comsub timed arms (echo/cat/tty + the time report), the front
  face's tty bare and slash forms, heredoc cat and sort -u;
- the #2066 host-flag gates riding the projected slots (Session
  Tier-C seam, #2066 probe technique): cat off -> PATH program,
  on -> in-process; sed off -> PATH program, on -> still the PATH
  program via the arm's InvertedSed recheck.

Two adjudications recorded in the battery itself: the sed
flag-on expectation follows the InvertedSed row (it is not a
plain Replace), and a bare trap-table print is deliberately not
pinned (it reflects signal dispositions inherited from the host
process, which this binary's own Session tests mutate - a
pre-existing host-visible side effect, orthogonal to S4).

Local gates: battery 17/17 (twice), lib suite 961/1/3 with the
failure set identical to the master baseline (the +2 passes are
the new registry pins), -D warnings clean on the lib and this
slice's test targets (the one all-targets -D warnings failure is
the pre-existing dead_code in the #2018 test file, owned by
PR #2079).

Refs #2036
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 29, 2026 08:21
@caomengxuan666
caomengxuan666 merged commit ffe729b into master Oct 29, 2026
11 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/alltargets-deadcode-status-field branch October 30, 2026 01:41
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