Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Nov 10, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

nxsaken and others added 15 commits October 30, 2025 13:54
This allows every check to be a single hashtable lookup instead of a linear
scan.
This also incorporates some requested improvements to the error message for
unknown directives.
Constify `ControlFlow` methods without unstable bounds

Feature: `min_const_control_flow`
Tracking issue: #148738

This PR constifies some of the methods on `ControlFlow`.
…crum

Constify `ControlFlow` methods with unstable bounds

Feature: `const_control_flow`
Tracking issue: #148739

This PR constifies the methods on `ControlFlow` with a dependency on #143874.
compiletest: Do the known-directives check only once, and improve its error message

This PR is a combination of three changes:
- Store the list of known directives in a set, so that checking a directive name doesn't require a linear scan
- Extract the known-directives check out of `iter_directives` and do it only once, instead of multiple times per file
- Improve the error message for unknown directives, [as requested on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Compiletest.20directive.20parsing.20error/with/553598083)

The change to error messages is fused with the extraction, since doing it independently would have been more awkward.

---

## Before

```text
Testing stage1 with compiletest suite=coverage mode=coverage-map (aarch64-apple-darwin)
errors encountered during EarlyProps parsing: /Users/stuart/Dev/rust/rust/tests/coverage/trivial.rs
2025-11-05T01:55:46.440012Z ERROR compiletest::directives: /Users/stuart/Dev/rust/rust/tests/coverage/trivial.rs:2: detected unknown compiletest test directive `add-core-stubs`

thread '<unnamed>' (36268582) panicked at src/tools/compiletest/src/directives.rs:72:13:
errors encountered during EarlyProps parsing
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

## After

```text
Testing stage1 with compiletest suite=coverage mode=coverage-map (aarch64-apple-darwin)

thread '<unnamed>' (36270772) panicked at src/tools/compiletest/src/lib.rs:876:9:
directives check failed:
ERROR: unknown compiletest directive `add-core-stubs` at /Users/stuart/Dev/rust/rust/tests/coverage/trivial.rs:2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
…ek,fmease

Fix invalid macro tag generation for keywords which can be followed by values

Fixes #148617.

The problem didn't come from the `generate-macro-expansion` feature but was actually uncovered thanks to it.

Keywords like `if` or `return`, when followed by a `!` were considered as macros, which was wrong and let to invalid class stack and to the panic.

~~While working on it, I realized that `_` was considered as a keyword, so I fixed that as well in the second commit.~~ (reverted, see #148655 (comment), #148655 (comment))

r? `@yotamofek`
Rollup of 4 pull requests

Successful merges:

 - #148248 (Constify `ControlFlow` methods without unstable bounds)
 - #148285 (Constify `ControlFlow` methods with unstable bounds)
 - #148510 (compiletest: Do the known-directives check only once, and improve its error message)
 - #148655 (Fix invalid macro tag generation for keywords which can be followed by values)

r? `@ghost`
`@rustbot` modify labels: rollup
Update LLVM to 21.1.5

Includes some fixes for BPF.
@pull pull bot locked and limited conversation to collaborators Nov 10, 2025
@pull pull bot added the ⤵️ pull label Nov 10, 2025
@pull pull bot merged commit 5f666a6 into relaxcn:master Nov 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants