Skip to content

Commit eb278f8

Browse files
committed
Auto merge of #140599 - petrochenkov:rawerann, r=jieyouxu
compiletest: Support matching on non-json lines in compiler output and migrate most of remaining `error-pattern`s to it. Such diagnostics use a new diagnostic kind `RAW`. Also emit an error for `error-pattern`s that can be replaced with line annotations. Also remove a number of conditions to check both line annotations and `error-pattern`s in more cases. Also respect `//@ check-stdout` when collecting "actual errors" for comparing against line annotations. (A couple of tiny refactorings is also included.) Continuation of rust-lang/rust#139760. r? `@jieyouxu`
2 parents 4782ecd + 0d29d41 commit eb278f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tests/ui.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ For checking runtime output, `//@ check-run-results` may be preferable.
344344

345345
Only use `error-pattern` if none of the above works.
346346

347-
Line annotations `//~` are still checked in tests using `error-pattern`.
348-
In exceptional cases, use `//@ compile-flags: --error-format=human` to opt out of these checks.
347+
Line annotations `//~` and `error-pattern` are compatible and can be used in the same test.
349348

350349
### Diagnostic kinds (error levels)
351350

@@ -356,9 +355,12 @@ The diagnostic kinds that you can have are:
356355
- `NOTE`
357356
- `HELP`
358357
- `SUGGESTION`
358+
- `RAW`
359359

360360
The `SUGGESTION` kind is used for specifying what the expected replacement text
361361
should be for a diagnostic suggestion.
362+
The `RAW` kind can be used for matching on lines from non-structured output sometimes emitted
363+
by the compiler instead of or in addition to structured json.
362364

363365
`ERROR` and `WARN` kinds are required to be exhaustively covered by line annotations
364366
`//~` by default.

0 commit comments

Comments
 (0)