File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,27 @@ of the error. These comments can take two forms:
4141 * ` CODE ` can take multiple forms such as: ` E#### ` , ` lint_name ` , ` tool::lint_name ` .
4242 * This will only match a diagnostic at the ` ERROR ` level.
4343
44+ The annotation can be put on a different line from the error location using ` v ` /` ^ ` :
45+ ``` rs
46+ causes_some_error ()
47+ // ~^ some_error
48+
49+ // ~v some_error
50+ causes_some_error ()
51+ ```
52+ By repeating those symbols ` n ` times, one can annotate an error located ` n ` lines away:
53+ ``` rs
54+ causes_some_error ()
55+
56+ // ~^^ some_error
57+ ```
58+ If there are multiple errors on the same line, annotations can be put on consecutive lines, and "chained" with ` | ` :
59+ ``` rs
60+ causes_some_error_and_other_error ()
61+ // ~^ some_error
62+ // ~| other_error
63+ ```
64+
4465In order to change how a single test is tested, you can add various ` //@ ` comments to the test.
4566Any other comments will be ignored, and all ` //@ ` comments must be formatted precisely as
4667their command specifies, or the test will fail without even being run.
You can’t perform that action at this time.
0 commit comments