Repository navigation
test: drop unused std::io::Write import in issue523 test (Refs #3776) - #3778
Merged
Merged
Conversation
tests/issue523_compgen_quoted_tilde_regressions.rs is #![cfg(windows)] and its line 24 'use std::io::Write;' is never referenced anywhere in the 104-line file. Under RUSTFLAGS="-D warnings" the whole-tree 'cargo check --tests' on Windows hard-errors on it (error: unused import: std::io::Write), same family as #3772. This PR deletes that one import line (+0/-1). No behaviour change: the import has no uses; the remaining 'Command'/'Stdio' imports are used by the test harness.
Member
Author
|
队长复核 PASS(2026-11-16 20:5x CST,头 3c28838):
|
caomengxuan666
marked this pull request as ready for review
November 16, 2026 12:48
caomengxuan666
added a commit
that referenced
this pull request
Nov 16, 2026
Refs #3779. 整树 `-D warnings` 普查(#3779)的 16 处 + Linux 腿对照发现的第 17 处。 全部是 tests/ 死代码/未用 import,src/ 不动,钉语义不动。 ## 清单与平台口径 cfg-gate(辅助只被 `#[cfg(unix)]` 钉调用,Windows 腿上死掉;Linux 腿保持原样): - issue2298:`RUBASH`、`Fixture`、`fixture`、`Fixture::run`/`read` + 2 个 import - issue2294:`test_dir`、`rubash_stdin`、`run_in`、`wait_file_contents` + 4 个 import - issue1331:`run_script` + `Write` import(`Command` 留给非门控钉) - issue1657:`Scratch`、`Scratch::new`/`run`、`Drop`、`passwd_home` + 5 个 import - issue2737:`run` + `Command` import - regression.rs:`issue_1584`/`issue_1582` 两 mod 整体 `#[cfg(unix)]`(两 mod 钉全为 unix 门控;初版只 gate 了两 `fn run`,X299 腿报 `use super::*;` 级联未用,改按文件内 `#[cfg(windows)] mod …` 先例 gate mod) - issue2390:`RUBASH`、`Outcome`、`run_script`、`normalize_fd_numbers`、`assert_case` + 3 个 import - issue1276:`Stdio` import(只在 unix 门控的 facet (2) 钉里用;facet (1) 只用 `Command`) - issue1021:`BufRead`/`BufReader`、`mpsc`、`Duration` import(只在 unix 钉里用;另一钉只用 `Command`/`Stdio`) - issue2278:`rubash_in_stdin_file` + 其 `Stdio` import(5 处调用全在 `#[cfg(unix)]` 钉里;初版误删,Linux 腿 E0425 ×5 抓获,已字节一致恢复 + gate,提交 70cc3f2) 真删(双腿皆死): - issue2473:`use std::io::Write as _` 全文件无 Write 方法调用 改名(值仍捕获、不断言,树内 `_stdout`/`_stderr` 惯例): - issue592:`stdout` → `_stdout`(find `-name 'data.txt'` 绑定,只断言 rc) - issue3540:`stdout` → `_stdout`(#3541 首绑定,只断言 stderr;`status` 已有 `let _ =`) - issue2036_s2:字段 `stderr` → `_stderr`(无 `.stderr` 读处) - d11:字段 `stderr` → `_stderr`(钉读 `.code`/`.stdout` + `{outcome:?}`) - issue2642:第 17 处,Linux 腿特有(`#![cfg(unix)]` 文件,Windows 普查看不见;前任 Linux base census 报 `field code is never read`):字段 `code` → `_code`(钉只读 `.stdout`/`.stderr`) 单文件删 import: - issue566:`Path`(`#![cfg(windows)]`,`PathBuf` 仍用) ## 本 PR 删除了什么 - `tests/issue2473_procsub_operand_marker_regressions.rs`:`use std::io::Write as _;` 一行。无 Write 方法调用。 - 其余 16 项为 cfg-gate 或 `_` 改名,无删除。(issue2278 的函数初版误删后已在 70cc3f2 字节一致恢复,不计删除。) ## 验证(队长复核,2026-11-16 21:0x CST;rebase 后双腿重跑) - 已 rebase 到 154a95a(#3778 合入点),新头 2bee55b,3 提交干净重放;基底比较 22 提交与本 PR 17 文件零交集。 - Linux `RUSTFLAGS="-D warnings" cargo check --locked --tests --keep-going`:唯一诊断为上游新带入的 `tests/issue3255_histexpand_prefix_invocation_name.rs:117`(`use super::*;` 未用;该文件与基底字节一致,blob sha 两边皆 6927ea8…,本 PR 未碰;master 自身 census 同样红)。队长裁决:该红另立单 #3789,不扩本单范围、不阻塞合入。 - X299(Windows)同命令:CHECK_RC=0,零诊断(35.58s;issue523 已随基底清掉)。 - CI run 43870362461(新头):除 goldens 与 census 外全绿;goldens 2 红与 master 154a95a 自身腿逐字相同(基线);census 与 master 失败集基本一致(360 行对 360 行,归一化后仅差一格 timing 敏感用例,皆非本单文件)。 - 合并后队长手关 #3779(Refs-only)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3776.
根因
tests/issue523_compgen_quoted_tilde_regressions.rs(#![cfg(windows)],104 行)第 24 行use std::io::Write;在全文件无任何引用。Windows 下整树RUSTFLAGS="-D warnings" cargo check --tests在此硬错(error: unused import: std::io::Write,exit 101),与 #3772 同类。本 PR 删除了什么
tests/issue523_compgen_quoted_tilde_regressions.rs第 24 行 import 一行(+0/−1)。Write/write!/writeln全文件仅此一处;相邻的Command/Stdioimport 仍被测试使用(第 33/35 行),未动。验证(X299-2607 Windows 腿,cargo 1.99.1)
RUSTFLAGS="-D warnings" cargo check --locked --test issue523_compgen_quoted_tilde_regressions→ exit 101,恰为上述一错。cargo test --locked --test issue523_compgen_quoted_tilde_regressions→ 4 passed;RUSTFLAGS="-D warnings" cargo check --locked --lib --bins→ exit 0。--tests --keep-going普查仍 exit 101,但 16 个红茎里已无 issue523(亦无 issue1794,test: cfg-gate unix-only helpers in issue1794 test (Refs #3772) #3775 已合入);余红皆为其他文件的同类死代码(见车道 REPORT),不在本单范围。#![cfg(windows)],在 Linux 上不编译、不跑。UNVERIFIED-BY-CAPTAIN