Skip to content

tidy: skip the file, not the whole directory, in tests_revision_unpaired_stdout_stderr - #160349

Open
lazureykis wants to merge 2 commits into
rust-lang:mainfrom
lazureykis:fix/tidy-revision-continue
Open

tidy: skip the file, not the whole directory, in tests_revision_unpaired_stdout_stderr#160349
lazureykis wants to merge 2 commits into
rust-lang:mainfrom
lazureykis:fix/tidy-revision-continue

Conversation

@lazureykis

Copy link
Copy Markdown
Contributor

tests_revision_unpaired_stdout_stderr has not been checking anything since f11713be75dd.

Two arms use return where continue was meant:

// Cannot have a revision component, skip.
[] | [_] => return,
...
[_, _] => return,

They sit in a per-sibling loop inside the closure walk_dir calls once per directory, so return abandons the directory instead of skipping the file. Nearly every tests/ui directory holds an ordinary foo.stderr that hits the second arm early, so the check exits before reaching anything worth flagging. The loop's other three guards already use continue.

Switching the keywords surfaces 39 stale output files across 28 tests, each named after a revision its test does not declare — e.g. async_gen_fn.rs declares e2015 mid e2024 but carries .e2018, .e2021 and .none. The first commit removes them and the second fixes the control flow, so x test tidy passes at every commit.

x test tests/ui: 21626 passed, 0 failed.

r? bootstrap

These 39 .stderr files across 28 tests are named after revisions the tests
do not declare, so compiletest never reads them. Most were left behind when a
test's revisions were renamed or removed -- for example the seven
tests/ui/dyn-compatibility/*.curr.stderr files, orphaned by the dyn
compatibility rename in 57b5d3a.

They are invisible to tidy today because the
tests_revision_unpaired_stdout_stderr check does not actually run; the next
commit fixes that. Removing them first keeps x test tidy passing at every
commit.
…dout_stderr

Two match arms used return where continue was meant. Both are inside a
per-sibling loop that is itself inside the closure passed to walk_dir, and
walk_dir invokes that closure once per directory -- so return abandoned the
whole directory instead of moving on to the next file.

files_under_inspection is a sorted BTreeSet and nearly every tests/ui
directory holds an ordinary two-component foo.stderr, which hits the second
arm early, so in practice the check exited almost every directory before
reaching a file worth flagging. It has been inert since f11713b.

The other three guards in the same loop already use continue, and the comment
on the first arm says skip, i.e. skip this file.
@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants