rust/compiler/rustc_interface/src
Matthias Krüger 0f81c7faf5
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
Report fatal lexer errors in `--cfg` command line arguments

Fixes #89358. The erroneous behavior was apparently introduced by `@Mark-Simulacrum` in a678e31911; the idea is to silence individual parser errors and instead emit one catch-all error message after parsing. However, for the example in #89358, a fatal lexer error is created here:
edebf77e00/compiler/rustc_parse/src/lexer/mod.rs (L340-L349)

This fatal error aborts the compilation, and so the call to `new_parser_from_source_str()` never returns and the catch-all error message is never emitted. I have therefore changed the `SilentEmitter` to silence only non-fatal errors; with my changes, for the rustc invocation described in #89358:
```sh
rustc --cfg "abc\""
```
I get the following output:
```
error[E0765]: unterminated double quote string
  |
  = note: this error occurred on the command line: `--cfg=abc"`
```
2021-10-23 05:28:22 +02:00
..
callbacks.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
interface.rs Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726 2021-10-23 05:28:22 +02:00
lib.rs Simplify scoped_thread 2021-09-23 12:56:59 -04:00
passes.rs Build jump table at runtime. 2021-10-20 18:32:29 +02:00
proc_macro_decls.rs Avoid more invocations of hir_crate query. 2021-09-29 23:16:47 +02:00
queries.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
tests.rs Enable AutoFDO. 2021-10-06 19:36:52 +00:00
util.rs Fix clippy lints 2021-10-01 23:17:19 +02:00