rust/compiler
Matthias Krüger afb6c4681a
Rollup merge of #124169 - compiler-errors:parser-fatal, r=oli-obk
Don't fatal when calling `expect_one_of` when recovering arg in `parse_seq`

In `parse_seq`, when parsing a sequence of token-separated items, if we don't see a separator, we try to parse another item eagerly in order to give a good diagnostic and recover from a missing separator:
d1a0fa5ed3/compiler/rustc_parse/src/parser/mod.rs (L900-L901)

If parsing the item itself calls `expect_one_of`, then we will fatal because of #58903:
d1a0fa5ed3/compiler/rustc_parse/src/parser/mod.rs (L513-L516)

For `precise_capturing` feature I implemented, we do end up calling `expected_one_of`:
d1a0fa5ed3/compiler/rustc_parse/src/parser/ty.rs (L712-L714)

This leads the compiler to fatal *before* having emitted the first error, leading to absolutely no useful information for the user about what happened in the parser.

This PR makes it so that we stop doing that.

Fixes #124195
2024-04-23 20:17:51 +02:00
..
rustc
rustc_abi
rustc_arena
rustc_ast Auto merge of #124008 - nnethercote:simpler-static_assert_size, r=Nilstrieb 2024-04-18 09:47:45 +00:00
rustc_ast_ir
rustc_ast_lowering Rollup merge of #123935 - tstsrt:fix-115423, r=oli-obk 2024-04-18 21:38:55 -07:00
rustc_ast_passes Rename BindingAnnotation to BindingMode 2024-04-17 09:34:39 -04:00
rustc_ast_pretty Give a name to each distinct manipulation of pretty-printer FixupContext 2024-04-19 23:49:44 -07:00
rustc_attr Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
rustc_baked_icu_data
rustc_borrowck Rollup merge of #124183 - compiler-errors:unnecessary-by-ref, r=oli-obk 2024-04-22 20:25:59 +02:00
rustc_builtin_macros Rename BindingAnnotation to BindingMode 2024-04-17 09:34:39 -04:00
rustc_codegen_cranelift Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo 2024-04-23 20:17:51 +02:00
rustc_codegen_gcc Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo 2024-04-23 20:17:51 +02:00
rustc_codegen_llvm Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo 2024-04-23 20:17:51 +02:00
rustc_codegen_ssa Auto merge of #121801 - zetanumbers:async_drop_glue, r=oli-obk 2024-04-23 02:10:23 +00:00
rustc_const_eval Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo 2024-04-23 20:17:51 +02:00
rustc_data_structures Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
rustc_driver
rustc_driver_impl Fix pretty hir for anon consts in diagnostics 2024-04-15 18:48:12 -04:00
rustc_error_codes consistency rename: language item -> lang item 2024-04-17 13:00:43 +02:00
rustc_error_messages
rustc_errors Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
rustc_expand Auto merge of #124008 - nnethercote:simpler-static_assert_size, r=Nilstrieb 2024-04-18 09:47:45 +00:00
rustc_feature Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco 2024-04-23 12:10:25 +02:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco 2024-04-23 12:10:25 +02:00
rustc_hir_analysis Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo 2024-04-23 20:17:51 +02:00
rustc_hir_pretty Rename BindingAnnotation to BindingMode 2024-04-17 09:34:39 -04:00
rustc_hir_typeck Auto merge of #122317 - compiler-errors:fulfill-method-probe, r=lcnr 2024-04-23 14:07:05 +00:00
rustc_incremental Fix ICE when there is a non-Unicode entry in the incremental crate directory 2024-04-21 11:24:55 +01:00
rustc_index Simplify static_assert_sizes. 2024-04-18 15:36:25 +10:00
rustc_index_macros
rustc_infer Rollup merge of #124183 - compiler-errors:unnecessary-by-ref, r=oli-obk 2024-04-22 20:25:59 +02:00
rustc_interface Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
rustc_lexer
rustc_lint Rollup merge of #123050 - RalfJung:panic_str, r=m-ou-se 2024-04-23 12:10:25 +02:00
rustc_lint_defs Rename feature gate 2024-04-15 23:27:21 -04:00
rustc_llvm Rollup merge of #124132 - RalfJung:OpBundlesIndirect, r=Mark-Simulacrum 2024-04-20 21:45:37 +01:00
rustc_log Construct SourceMap at the same time as SessionGlobals. 2024-04-16 13:02:53 +10:00
rustc_macros
rustc_metadata Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco 2024-04-23 12:10:25 +02:00
rustc_middle Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco 2024-04-23 12:10:25 +02:00
rustc_mir_build coverage: Move some helper code into BranchInfoBuilder 2024-04-22 21:55:33 +10:00
rustc_mir_dataflow
rustc_mir_transform Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco 2024-04-23 12:10:25 +02:00
rustc_monomorphize Use non-exhaustive matches for TyKind 2024-04-17 20:49:53 +03:00
rustc_next_trait_solver
rustc_parse Rollup merge of #124169 - compiler-errors:parser-fatal, r=oli-obk 2024-04-23 20:17:51 +02:00
rustc_parse_format Simplify static_assert_sizes. 2024-04-18 15:36:25 +10:00
rustc_passes Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco 2024-04-23 12:10:25 +02:00
rustc_pattern_analysis
rustc_privacy
rustc_query_impl Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
rustc_query_system Rollup merge of #124252 - michaelwoerister:better-forbidden-read-ice, r=oli-obk 2024-04-22 20:26:00 +02:00
rustc_resolve Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco 2024-04-23 12:10:25 +02:00
rustc_sanitizers Update encode.rs 2024-04-14 14:56:41 +02:00
rustc_serialize Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
rustc_session Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
rustc_smir Auto merge of #121801 - zetanumbers:async_drop_glue, r=oli-obk 2024-04-23 02:10:23 +00:00
rustc_span Rollup merge of #123050 - RalfJung:panic_str, r=m-ou-se 2024-04-23 12:10:25 +02:00
rustc_symbol_mangling Add simple async drop glue generation 2024-04-16 20:45:07 +03:00
rustc_target Auto merge of #117457 - daxpedda:wasm-nontrapping-fptoint, r=wesleywiser 2024-04-21 06:32:10 +00:00
rustc_trait_selection Rollup merge of #124168 - oli-obk:define_opaque_types12, r=lcnr 2024-04-23 06:24:56 +02:00
rustc_traits
rustc_transmute ScalarInt: add methods to assert being a (u)int of given size 2024-04-19 13:51:52 +02:00
rustc_ty_utils Auto merge of #121801 - zetanumbers:async_drop_glue, r=oli-obk 2024-04-23 02:10:23 +00:00
rustc_type_ir Rollup merge of #123797 - amandasystems:better-graphviz, r=oli-obk 2024-04-16 15:19:14 +02:00
stable_mir Auto merge of #121801 - zetanumbers:async_drop_glue, r=oli-obk 2024-04-23 02:10:23 +00:00