diff options
| author | Jakub Kądziołka <kuba@kadziolka.net> | 2022-01-01 05:12:56 +0100 |
|---|---|---|
| committer | Jakub Kądziołka <kuba@kadziolka.net> | 2022-01-01 05:21:36 +0100 |
| commit | 193342eb8d38afb7327642ced3434730b6f4fa00 (patch) | |
| tree | 94b345629e4f4311727daa40bfa6d5dd64df061e /src/test/ui/conditional-compilation | |
| parent | 8ed935e92dfb09ae388344b12284bf5110cf9265 (diff) | |
| download | rust-193342eb8d38afb7327642ced3434730b6f4fa00.tar.gz rust-193342eb8d38afb7327642ced3434730b6f4fa00.zip | |
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.
Diffstat (limited to 'src/test/ui/conditional-compilation')
| -rw-r--r-- | src/test/ui/conditional-compilation/cfg-arg-invalid-8.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/conditional-compilation/cfg-arg-invalid-8.stderr | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-8.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-8.rs new file mode 100644 index 00000000000..1d7fa788534 --- /dev/null +++ b/src/test/ui/conditional-compilation/cfg-arg-invalid-8.rs @@ -0,0 +1,3 @@ +// compile-flags: --cfg ) +// error-pattern: invalid `--cfg` argument: `)` (expected `key` or `key="value"`) +fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-8.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-8.stderr new file mode 100644 index 00000000000..7bb1814127b --- /dev/null +++ b/src/test/ui/conditional-compilation/cfg-arg-invalid-8.stderr @@ -0,0 +1,2 @@ +error: invalid `--cfg` argument: `)` (expected `key` or `key="value"`) + |
