Skip to content

compiletest: Prepare all simple //@ needs-* conditions in advance#156692

Open
Zalathar wants to merge 3 commits into
rust-lang:mainfrom
Zalathar:needs
Open

compiletest: Prepare all simple //@ needs-* conditions in advance#156692
Zalathar wants to merge 3 commits into
rust-lang:mainfrom
Zalathar:needs

Conversation

@Zalathar
Copy link
Copy Markdown
Member

This PR makes compiletest check almost all //@ needs-* conditions in advance, separate from individual tests or directives. The results of these checks are stored in a prepared hashmap that can then be inspected by individual tests when encountering a needs-* directive.

This is similar to how ignore-*/only-* directives work (as of #149470), though currently the two mechanisms don't share code, as they have subtly different requirements.

r? jieyouxu

Zalathar added 3 commits May 18, 2026 16:30
This intermediate commit makes subsequent diffs/blame a bit nicer, by
encouraging git's blame view to preserve line history for the remaining parts
of `handle_needs`, which would otherwise be obscured.

A subsequent commit will move the list back into `needs.rs` in an altered form.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 18, 2026

Some changes occurred in src/tools/compiletest

cc @jieyouxu

compiletest directives have been modified. Please add or update docs for the
new or modified directive in src/doc/rustc-dev-guide/.

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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) labels May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants