Skip to content

UI test suite clarity changes: Rename tests/ui/SUMMARY.md and update rustc dev guide on error-pattern #144340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/doc/rustc-dev-guide/src/tests/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ fn main((ؼ

Use `//~?` to match an error without line information.
`//~?` is precise and will not match errors if their line information is available.
It should be preferred to using `error-pattern`, which is imprecise and non-exhaustive.
For tests wishing to match against compiler diagnostics, error annotations should
be preferred over //@ error-pattern, //@ error-pattern is imprecise and non-exhaustive.

```rust,ignore
//@ compile-flags: --print yyyy
Expand Down Expand Up @@ -347,8 +348,6 @@ fn main() {
}
```

Use of `error-pattern` is not recommended in general.

For strict testing of compile time output, try to use the line annotations `//~` as much as
possible, including `//~?` annotations for diagnostics without spans.

Expand All @@ -359,7 +358,8 @@ Some of the compiler messages can stay uncovered by annotations in this mode.

For checking runtime output, `//@ check-run-results` may be preferable.

Only use `error-pattern` if none of the above works.
Only use `error-pattern` if none of the above works, such as when finding a
specific string pattern in a runtime panic output.

Line annotations `//~` and `error-pattern` are compatible and can be used in the same test.

Expand Down
File renamed without changes.
Loading