File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/doc/rustc-dev-guide/src/tests Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,8 @@ fn main((ؼ
309
309
310
310
Use ` //~? ` to match an error without line information.
311
311
` //~? ` 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 compile time tests, it should be preferred to using ` error-pattern ` , which
313
+ is imprecise and non-exhaustive.
313
314
314
315
``` rust,ignore
315
316
//@ compile-flags: --print yyyy
@@ -347,8 +348,6 @@ fn main() {
347
348
}
348
349
```
349
350
350
- Use of ` error-pattern ` is not recommended in general.
351
-
352
351
For strict testing of compile time output, try to use the line annotations ` //~ ` as much as
353
352
possible, including ` //~? ` annotations for diagnostics without spans.
354
353
@@ -359,7 +358,8 @@ Some of the compiler messages can stay uncovered by annotations in this mode.
359
358
360
359
For checking runtime output, ` //@ check-run-results ` may be preferable.
361
360
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.
363
363
364
364
Line annotations ` //~ ` and ` error-pattern ` are compatible and can be used in the same test.
365
365
File renamed without changes.
You can’t perform that action at this time.
0 commit comments