Skip to content

WIP: fix(tests): drop unneeded mut in issue1184 run_rubash_file - #2002

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/1184-unused-mut
Oct 28, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/1184-unused-mut

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

One-line stock-wart fix on master (d48197c).

The wart (verbatim from cargo check --all-targets with RUSTFLAGS="-D warnings")

error: variable does not need to be mutable
  --> tests/issue1184_f4_procsub_diag_line_regressions.rs:38:9
   |
38 |     let mut child = Command::new(env!("CARGO_BIN_EXE_rubash"))
   |         ----^^^^^
   |         help: remove this `mut`

Fix

Remove the mut at line 38 only. The sibling let mut child at line 56 (run_stdin) is not flagged and stays: it writes through child.stdin.as_mut(). Diff is exactly 1 line; per-file rustfmt applied; CR count 0.

Verification

  • cargo check --test issue1184_f4_procsub_diag_line_regressions under -D warnings: clean (rc=0).
  • Full cargo check --all-targets --keep-going error census: 25 → 24, with zero remaining errors in the issue1184 file.
  • lib tests A/B (same tree, fix stashed vs applied): 924 passed / 1 failed / 3 ignored both ways, the single failure name-identical: builtins::test::tests::ownership_unary_operators_check_existing_file (known tree baseline).

Out of scope, flagged for disposition

--all-targets -D warnings is not fully green on master: 24 pre-existing errors remain across 18 other test files (never-read status/code/stderr fields, unused variables/imports, non-snake-case fn names, dead fns — in issue530/544/1520/1548/1687/1845/1847/282/528/531/555/621/651/705/804, multi_session_isolation, oils_spec_arith, debugger_flag_gnu_parity). They predate and are unrelated to this wart; full census is in the cluster REPORT (~/workspace/fix-1184-wart/REPORT.md). This PR deliberately does not touch them.

cargo check --all-targets under RUSTFLAGS=-D warnings flagged
tests/issue1184_f4_procsub_diag_line_regressions.rs:38: the child in
run_rubash_file is only consumed by wait_with_output() and never needs
a mutable binding (the run_stdin sibling at line 56 keeps its mut: it
writes through child.stdin.as_mut()). Stock wart on master, unrelated
to any in-flight work.
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 28, 2026 23:34
@caomengxuan666
caomengxuan666 merged commit 549c1b7 into master Oct 28, 2026
10 of 11 checks passed
SpookyWaste pushed a commit to SpookyWaste/rubash that referenced this pull request Oct 29, 2026
Master's cargo check --all-targets under RUSTFLAGS=-D warnings carried
24 pre-existing errors across 18 test files (census: fix-1184-wart
REPORT; the 25th, tests/issue1184, was fixed by unixwin#2002). CI never sees
them: master CI does not run --all-targets -D warnings and niu CI only
compiles the rubash lib with -D warnings.

Dispositions, per compiler diagnosis, tests/ only, no src/ changes:
- never-read harness fields removed (Output.status x5, Run.code,
  Run.stderr x2) together with their construction sites
- unused imports removed (debugger_flag Path; issue705 Write + Stdio;
  issue804 Write, orphaned by the run_face removal)
- unused variables bound as _ (issue1520 stdout, issue282 rc);
  unused parameter workload(i) -> _i in multi_session_isolation
- unused mut removed (issue1845 stdin-file arm; multi_session b,
  which is only dropped)
- dead helpers removed: issue531 e_lines (zero callers), issue804
  run_face (zero callers; tests drive run_command/run_r)
- issue555 quoted_cases gated #[cfg(windows)] to match its sole caller
- six #[test] names that mirror literal flag/spec spellings
  (declare -nA x2, declare -aA / -a -A, Oils arith/invalid-const-A /
  -B-fresh) keep their names under per-item #[allow(non_snake_case)]
  with the reason on the line; snake_case would collide with the
  distinct -na / -a shapes they must stay distinguishable from

No blanket allows, no behavior changes: every removed field/helper was
provably unread/uncalled (that is the lint itself), and no assertion
was touched.
@caomengxuan666
caomengxuan666 deleted the fix/1184-unused-mut 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