diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-25 11:16:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-25 11:16:38 +0200 |
| commit | 405b2e6c06a92567cf93cba3fa1f0a5fd706be0f (patch) | |
| tree | d768023eea8047aa8a991f3ae8bd6ce830a0c96b | |
| parent | a2681f943c6faa87bfaae0aad047afc141882bc9 (diff) | |
| parent | 94c0cf891e4427083072b9050b89dd0332a616ae (diff) | |
| download | rust-405b2e6c06a92567cf93cba3fa1f0a5fd706be0f.tar.gz rust-405b2e6c06a92567cf93cba3fa1f0a5fd706be0f.zip | |
Rollup merge of #144340 - Oneirical:uncertain-illusion, r=jieyouxu
UI test suite clarity changes: Rename `tests/ui/SUMMARY.md` and update rustc dev guide on `error-pattern` To match convention, rename `tests/ui/SUMMARY.md` to `tests/ui/README.md`. Also, remove misleading lines in the rustc development guide about `error-pattern` being "not recommended", when it really is just a last resort which *should* be used in the niche situations where it is useful. r? ````@jieyouxu````
| -rw-r--r-- | src/doc/rustc-dev-guide/src/tests/ui.md | 8 | ||||
| -rw-r--r-- | tests/ui/README.md (renamed from tests/ui/SUMMARY.md) | 0 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/rustc-dev-guide/src/tests/ui.md b/src/doc/rustc-dev-guide/src/tests/ui.md index 9bfc60e08a6..b1feef9ed0c 100644 --- a/src/doc/rustc-dev-guide/src/tests/ui.md +++ b/src/doc/rustc-dev-guide/src/tests/ui.md @@ -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 @@ -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. @@ -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. diff --git a/tests/ui/SUMMARY.md b/tests/ui/README.md index b635b6326fc..b635b6326fc 100644 --- a/tests/ui/SUMMARY.md +++ b/tests/ui/README.md |
