rust/compiler
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
..
rustc Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_apfloat Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_arena Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_ast Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726 2021-10-22 19:42:48 +09:00
rustc_ast_lowering Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
rustc_ast_passes Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
rustc_ast_pretty Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
rustc_attr Correct typo 2021-10-16 13:36:05 -07:00
rustc_borrowck Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
rustc_builtin_macros rustc_span: Ident::invalid -> Ident::empty 2021-10-17 23:20:30 +03:00
rustc_codegen_cranelift Make hash_result an Option. 2021-10-20 18:29:18 +02:00
rustc_codegen_gcc Make hash_result an Option. 2021-10-20 18:29:18 +02:00
rustc_codegen_llvm Make hash_result an Option. 2021-10-20 18:29:18 +02:00
rustc_codegen_ssa Auto merge of #90050 - michaelwoerister:fix-vtable-debug-name-crash-90019, r=wesleywiser 2021-10-20 14:37:48 +00:00
rustc_const_eval Rollup merge of #90069 - tmiasko:promoted-const-qualif, r=oli-obk 2021-10-22 19:42:49 +09:00
rustc_data_structures Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_driver Auto merge of #89124 - cjgillot:owner-info, r=michaelwoerister 2021-10-18 19:53:05 +00:00
rustc_error_codes Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726 2021-10-22 19:42:46 +09:00
rustc_errors Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726 2021-10-23 05:28:22 +02:00
rustc_expand Rollup merge of #89991 - petrochenkov:visitok2, r=jackh726 2021-10-22 19:42:48 +09:00
rustc_feature Revert "Stabilize arbitrary_enum_discriminant" 2021-10-14 10:57:56 -04:00
rustc_fs_util Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_graphviz Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_hir Rollup merge of #90071 - cjgillot:no-blocks, r=oli-obk 2021-10-21 14:11:08 +09:00
rustc_hir_pretty Auto merge of #89124 - cjgillot:owner-info, r=michaelwoerister 2021-10-18 19:53:05 +00:00
rustc_incremental Merge two query callbacks arrays. 2021-10-20 18:29:27 +02:00
rustc_index Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_infer nice_region_error: Include lifetime placeholders in error output 2021-10-22 15:26:20 -07:00
rustc_interface Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726 2021-10-23 05:28:22 +02:00
rustc_lexer Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_lint Rollup merge of #89895 - camsteffen:for-loop-head-span, r=davidtwco 2021-10-22 19:42:45 +09:00
rustc_lint_defs Add feature gate to non_exhaustive_omitted_patterns lint 2021-10-08 17:40:39 -04:00
rustc_llvm RustWrapper: adapt for an LLVM API change 2021-10-18 09:48:47 +02:00
rustc_macros Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_metadata Don't emit a warning for empty rmeta files. 2021-10-19 16:56:47 -07:00
rustc_middle Auto merge of #89893 - camsteffen:redundant-dump-enabled, r=matthewjasper 2021-10-22 17:32:20 +00:00
rustc_mir_build Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino 2021-10-22 19:42:48 +09:00
rustc_mir_dataflow Adopt let_else across the compiler 2021-10-16 07:18:05 +02:00
rustc_mir_transform Auto merge of #89893 - camsteffen:redundant-dump-enabled, r=matthewjasper 2021-10-22 17:32:20 +00:00
rustc_monomorphize Auto merge of #89933 - est31:let_else, r=michaelwoerister 2021-10-19 14:41:39 +00:00
rustc_parse Rollup merge of #89257 - aDotInTheVoid:macro-error-2, r=estebank 2021-10-22 19:42:43 +09:00
rustc_parse_format Migrate to 2021 2021-09-20 22:21:42 -04:00
rustc_passes Use Ancestory to check default fn in const impl instead of comparing idents 2021-10-11 18:19:54 +01:00
rustc_plugin_impl Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
rustc_privacy Rollup merge of #88644 - eopb:abstractconst_leaf_subst, r=lcnr 2021-10-21 14:11:03 +09:00
rustc_query_impl Build jump table at runtime. 2021-10-20 18:32:29 +02:00
rustc_query_system Address review. 2021-10-20 18:51:15 +02:00
rustc_resolve Revert "Auto merge of #89100 - petrochenkov:localbind, r=cjgillot" 2021-10-21 09:09:24 -04:00
rustc_save_analysis Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
rustc_serialize Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov" 2021-10-15 11:28:23 +02:00
rustc_session Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726 2021-10-23 05:28:22 +02:00
rustc_span Rollup merge of #88860 - nbdd0121:panic, r=m-ou-se 2021-10-20 04:35:14 +09:00
rustc_symbol_mangling Remove re-export. 2021-10-03 16:08:54 +02:00
rustc_target Auto merge of #90040 - nbdd0121:issue-90038, r=oli-obk 2021-10-19 08:13:35 +00:00
rustc_trait_selection Rollup merge of #90028 - tmiasko:structural-match-closure, r=spastorino 2021-10-22 19:42:48 +09:00
rustc_traits Move some outlives bounds things from rustc_trait_selection to rustc_typeck 2021-10-15 12:14:19 -04:00
rustc_ty_utils Replace FnLikeNode by FnKind. 2021-10-19 23:31:51 +02:00
rustc_type_ir Add two inline annotations for hot functions 2021-10-03 12:43:43 -04:00
rustc_typeck Rollup merge of #90074 - klensy:upvar-all, r=wesleywiser 2021-10-21 14:11:09 +09:00