Skip to content

Commit 3ecf508

Browse files
author
The rustc-josh-sync Cronjob Bot
committed
Merge ref '2b5e239c6b86' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 2b5e239c6b86cde974b0ef0f8e23754fb08ff3c5 Filtered ref: dde2393 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 3a02592 + dde2393 commit 3ecf508

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tests/ui.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ fn main((ؼ
309309

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

314315
```rust,ignore
315316
//@ compile-flags: --print yyyy
@@ -347,8 +348,6 @@ fn main() {
347348
}
348349
```
349350

350-
Use of `error-pattern` is not recommended in general.
351-
352351
For strict testing of compile time output, try to use the line annotations `//~` as much as
353352
possible, including `//~?` annotations for diagnostics without spans.
354353

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

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

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

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

0 commit comments

Comments
 (0)