Repository navigation
test: gate unix-only test helpers + drop dead test code (Refs #3779) - #3781
Merged
Merged
Conversation
The fn-level gates left 'use super::*;' with no live user on Windows (-D warnings flags it). Both mods are unix-only throughout, so gate the mods (file precedent: #[cfg(windows)] mod issue_2225 etc.) and drop the now-redundant fn gates. Refs #3779
…bad delete) The 2eb34fd delete was wrong: rubash_in_stdin_file has 5 call sites, all inside #[cfg(unix)] tests. The Windows census flagged it only because the callers do not exist on Windows; the Linux --keep-going leg fails with E0425 x5. Restore byte-identical and gate it (plus its Stdio import) with #[cfg(unix) instead. Refs #3779
caomengxuan666
force-pushed
the
fix/3779-test-dead-code-census
branch
from
November 16, 2026 12:51
70cc3f2 to
2bee55b
Compare
Member
Author
Member
Author
|
队长复核 PASS(2026-11-16 21:0x CST,新头 2bee55b,基底 154a95a):
|
caomengxuan666
marked this pull request as ready for review
November 16, 2026 13:10
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.
test: gate unix-only test helpers + drop dead test code (Refs #3779)
整树
-D warnings普查(#3779)的 16 处 + Linux 腿对照发现的第 17 处。全部是 tests/ 死代码/未用 import,src/ 不动,钉语义不动。
清单与平台口径
cfg-gate(辅助只被
#[cfg(unix)]钉调用,Windows 腿上死掉;Linux 腿保持原样):RUBASH、Fixture、fixture、Fixture::run/read+ 2 个 importtest_dir、rubash_stdin、run_in、wait_file_contents+ 4 个 importrun_script+Writeimport(Command留给非门控钉)Scratch、Scratch::new/run、Drop、passwd_home+ 5 个 importrun+Commandimportissue_1584/issue_1582两 mod 整体#[cfg(unix)](两 mod 钉全为 unix 门控;初版只 gate 了两fn run,X299 腿报use super::*;级联未用,改按文件内#[cfg(windows)] mod …先例 gate mod)RUBASH、Outcome、run_script、normalize_fd_numbers、assert_case+ 3 个 importStdioimport(只在 unix 门控的 facet (2) 钉里用;facet (1) 只用Command)BufRead/BufReader、mpsc、Durationimport(只在 unix 钉里用;另一钉只用Command/Stdio)rubash_in_stdin_file+ 其Stdioimport(5 处调用全在#[cfg(unix)]钉里;初版误删,Linux 腿 E0425 ×5 抓获,已字节一致恢复 + gate,提交 70cc3f2)真删(双腿皆死):
use std::io::Write as _全文件无 Write 方法调用改名(值仍捕获、不断言,树内
_stdout/_stderr惯例):stdout→_stdout(find-name 'data.txt'绑定,只断言 rc)stdout→_stdout([bug] ${a[$(...)]:?err}: an arithmetic error in the subscript still emits the :? report #3541 首绑定,只断言 stderr;status已有let _ =)stderr→_stderr(无.stderr读处)stderr→_stderr(钉读.code/.stdout+{outcome:?})#![cfg(unix)]文件,Windows 普查看不见;前任 Linux base census 报field code is never read):字段code→_code(钉只读.stdout/.stderr)单文件删 import:
Path(#![cfg(windows)],PathBuf仍用)本 PR 删除了什么
tests/issue2473_procsub_operand_marker_regressions.rs:use std::io::Write as _;一行。无 Write 方法调用。_改名,无删除。(issue2278 的函数初版误删后已在 70cc3f2 字节一致恢复,不计删除。)验证(rebase 后双腿重跑,待队长复核,腿日志见 REPORT §8)
RUSTFLAGS="-D warnings" cargo check --locked --tests --keep-going:CENSUS_RC=101,唯一诊断为上游新带入的tests/issue3255_histexpand_prefix_invocation_name.rs:117(use super::*;未用;该文件与基底字节一致,本 PR 未碰;master 自身 census 同样红)。Refs #3779
UNVERIFIED-BY-CAPTAIN