Emit an error for --cfg=)

Fixes #73026

See also: #64467, #89468

The issue stems from a `FatalError` being silently raised in
`panictry_buffer`. Normally this is not a problem, because
`panictry_buffer` emits the causes of the error, but they are not
themselves fatal, so they get filtered out by the silent emitter.

To fix this, we use a parser entrypoint which doesn't use
`panictry_buffer`, and we handle the error ourselves.
This commit is contained in:
Jakub Kądziołka 2022-01-01 05:12:56 +01:00
parent 8ed935e92d
commit 193342eb8d
No known key found for this signature in database
GPG key ID: E315A75846131564
3 changed files with 24 additions and 19 deletions

View file

@ -0,0 +1,3 @@
// compile-flags: --cfg )
// error-pattern: invalid `--cfg` argument: `)` (expected `key` or `key="value"`)
fn main() {}

View file

@ -0,0 +1,2 @@
error: invalid `--cfg` argument: `)` (expected `key` or `key="value"`)