@@ -303,7 +303,7 @@ It should be preferred to using `error-pattern`, which is imprecise and non-exha
303
303
### ` error-pattern `
304
304
305
305
The ` error-pattern ` [ directive] ( directives.md ) can be used for runtime messages, which don't
306
- have a specific span, or in exceptional cases for compile time messages.
306
+ have a specific span, or in exceptional cases, for compile time messages.
307
307
308
308
Let's think about this test:
309
309
@@ -316,7 +316,7 @@ fn main() {
316
316
}
317
317
```
318
318
319
- We want to ensure this shows "index out of bounds" but we cannot use the ` ERROR `
319
+ We want to ensure this shows "index out of bounds", but we cannot use the ` ERROR `
320
320
annotation since the runtime error doesn't have any span. Then it's time to use the
321
321
` error-pattern ` directive:
322
322
@@ -333,18 +333,19 @@ fn main() {
333
333
Use of ` error-pattern ` is not recommended in general.
334
334
335
335
For strict testing of compile time output, try to use the line annotations ` //~ ` as much as
336
- possible, including ` //~? ` annotations for diagnostics without span .
336
+ possible, including ` //~? ` annotations for diagnostics without spans .
337
337
338
338
If the compile time output is target dependent or too verbose, use directive
339
339
` //@ dont-require-annotations: <diagnostic-kind> ` to make the line annotation checking
340
- non-exhaustive, some of the compiler messages can stay uncovered by annotations in this mode.
340
+ non-exhaustive.
341
+ Some of the compiler messages can stay uncovered by annotations in this mode.
341
342
342
- For checking runtime output ` //@ check-run-results ` may be preferable.
343
+ For checking runtime output, ` //@ check-run-results ` may be preferable.
343
344
344
345
Only use ` error-pattern ` if none of the above works.
345
346
346
347
Line annotations ` //~ ` are still checked in tests using ` error-pattern ` .
347
- In exceptional cases use ` //@ compile-flags: --error-format=human ` to opt out of these checks.
348
+ In exceptional cases, use ` //@ compile-flags: --error-format=human ` to opt out of these checks.
348
349
349
350
### Diagnostic kinds (error levels)
350
351
0 commit comments