rust/compiler/rustc_errors/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
..
json Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
annotate_snippet_emitter_writer.rs Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix. 2021-08-27 11:50:44 +02:00
diagnostic_builder.rs Auto merge of #87915 - estebank:fancy-spans, r=oli-obk 2021-09-13 16:31:12 +00:00
diagnostic.rs Make diagnostics clearer for ? operators 2021-09-17 13:13:28 +09:00
emitter.rs Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726 2021-10-23 05:28:22 +02:00
json.rs Path remapping: Make behavior of diagnostics output dependent on presence of --remap-path-prefix. 2021-08-27 11:50:44 +02:00
lib.rs Auto merge of #89933 - est31:let_else, r=michaelwoerister 2021-10-19 14:41:39 +00:00
lock.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
registry.rs Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
snippet.rs Modify structured suggestion output 2021-08-11 09:46:24 +00:00
styled_buffer.rs review 2021-04-24 22:37:42 +03:00