File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,8 @@ fn main((ؼ
309309
310310Use ` //~? ` 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-
352351For strict testing of compile time output, try to use the line annotations ` //~ ` as much as
353352possible, 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
360359For 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
364364Line annotations ` //~ ` and ` error-pattern ` are compatible and can be used in the same test.
365365
You can’t perform that action at this time.
0 commit comments