File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/doc/rustc-dev-guide/src/tests Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -422,6 +422,23 @@ the different revisions.
422422>
423423> By convention, the ` FALSE ` cfg is used to have an always-false config.
424424
425+ ### Automatic error annotations
426+
427+ ` compiletest ` provides the ` --try-annotate ` flag to add missing annotations.
428+
429+ Note that this flag is an experimental and crude tool. If you use it, you should carefully review
430+ and modify its changes:
431+ - trim down the annotation so it tests what you want to test, for example some particular wording
432+ of a diagnostic or just the error code/lint name.
433+ - delete or normalize parts of the annotations that refer to line numbers, like
434+ ` {async block@src/main.rs:8:13: 8:18} ` , so that they don't cause churn later when the UI test
435+ itself changes.
436+
437+ You have to pass this flag to ` compiletest ` like so:
438+ ``` text
439+ ./x test tests/ui -- --try-annotate
440+ ```
441+
425442## Controlling pass/fail expectations
426443
427444By default, a UI test is expected to ** generate a compile error** because most
You can’t perform that action at this time.
0 commit comments