Skip to content

compiletest: Enforce that directives are consistently used with or without a colon#156450

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:colon-or-not
May 14, 2026
Merged

compiletest: Enforce that directives are consistently used with or without a colon#156450
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Zalathar:colon-or-not

Conversation

@Zalathar
Copy link
Copy Markdown
Member

With the notable exception of //@ pp-exact, all directives expect to either always be used with a colon, or always be used without a colon. For example:

  • //@ uses-colon: value
  • //@ no-colon or //@ no-colon (remark)

Currently we just silently discard directives that use the wrong syntax, which is not great.

This PR therefore makes parse_name_directive and parse_name_value_directive panic if the wrong syntax is encountered.

The parser for pp-exact has been adjusted to check for the colon before deciding which parse method to call.

r? jieyouxu

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 11, 2026

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@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) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 11, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 11, 2026

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

@rust-log-analyzer

This comment was marked as off-topic.

@jieyouxu jieyouxu closed this May 12, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 12, 2026
@jieyouxu jieyouxu reopened this May 12, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 12, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 13, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Copy Markdown
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 14, 2026

📌 Commit 38d2c11 has been approved by jieyouxu

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 14, 2026
@jieyouxu
Copy link
Copy Markdown
Member

rust-bors Bot pushed a commit that referenced this pull request May 14, 2026
Rollup of 2 pull requests

Successful merges:

 - #156450 (compiletest: Enforce that directives are consistently used with or without a colon)
 - #156531 (compiletest: Rename `//@ ignore-pass` to `//@ no-pass-override`)
@rust-bors rust-bors Bot merged commit 772f42b into rust-lang:main May 14, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 14, 2026
rust-timer added a commit that referenced this pull request May 14, 2026
Rollup merge of #156450 - Zalathar:colon-or-not, r=jieyouxu

compiletest: Enforce that directives are consistently used with or without a colon

With the notable exception of `//@ pp-exact`, all directives expect to either always be used *with* a colon, or always be used *without* a colon. For example:

- `//@ uses-colon: value`
- `//@ no-colon` or `//@ no-colon (remark)`

Currently we just silently discard directives that use the wrong syntax, which is not great.

This PR therefore makes `parse_name_directive` and `parse_name_value_directive` panic if the wrong syntax is encountered.

The parser for `pp-exact` has been adjusted to check for the colon before deciding which parse method to call.

r? jieyouxu
@Zalathar Zalathar deleted the colon-or-not branch May 14, 2026 08:51
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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants