Auto merge of #139137 - petrochenkov:errwhere2, r=jieyouxu

compiletest: Require `//~` annotations even if `error-pattern` is specified

This is continuation of #138865 with some help from #139100.

`error-pattern` annotations that duplicate the newly added `//~` annotations are removed, other `error-pattern`s are not touched yet.

In exceptional cases `//@ compile-flags: --error-format=human` can be used to opt out of these checks.
In this PR I only had to use the opt out 3 times:
- `tests/ui/parser/utf16-{be,le}-without-bom.rs` - there are too many errors that are nearly identical (modulo location), because an error is reported on every second symbol
- `tests/ui-fulldeps/missing-rustc-driver-error.rs` - the errors list various rustc crate dependencies and may unexpectedly invalidate on random rustc changes
This commit is contained in:
bors 2025-04-03 12:05:32 +00:00
commit 9cebb04a9d
1 changed files with 3 additions and 0 deletions

View File

@ -335,6 +335,9 @@ But for strict testing, try to use the `ERROR` annotation as much as possible,
including `//~?` annotations for diagnostics without span. including `//~?` annotations for diagnostics without span.
For compile time diagnostics `error-pattern` should very rarely be necessary. For compile time diagnostics `error-pattern` should very rarely be necessary.
Per-line annotations (`//~`) are still checked in tests using `error-pattern`,
to opt out of these checks in exceptional cases use `//@ compile-flags: --error-format=human`.
### Error levels ### Error levels
The error levels that you can have are: The error levels that you can have are: