rust/tests/ui/impl-trait/precise-capturing
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
..
apit.rs More polishing 2024-04-15 16:45:48 -04:00
apit.stderr More polishing 2024-04-15 16:45:48 -04:00
bad-lifetimes.rs
bad-lifetimes.stderr
bad-params.rs More polishing 2024-04-15 16:45:48 -04:00
bad-params.stderr More polishing 2024-04-15 16:45:48 -04:00
capture-parent-arg.rs Flip spans for precise capturing syntax not capturing a ty/ct param 2024-04-20 10:35:04 -04:00
capture-parent-arg.stderr Flip spans for precise capturing syntax not capturing a ty/ct param 2024-04-20 10:35:04 -04:00
elided.rs More polishing 2024-04-15 16:45:48 -04:00
elided.stderr More polishing 2024-04-15 16:45:48 -04:00
forgot-to-capture-const.rs
forgot-to-capture-const.stderr Explicitly mention Self 2024-04-20 11:39:43 -04:00
forgot-to-capture-lifetime.rs Add hir::Node::PreciseCapturingNonLifetimeArg 2024-04-15 16:45:25 -04:00
forgot-to-capture-lifetime.stderr Add hir::Node::PreciseCapturingNonLifetimeArg 2024-04-15 16:45:25 -04:00
forgot-to-capture-type.rs Explicitly mention Self 2024-04-20 11:39:43 -04:00
forgot-to-capture-type.stderr Explicitly mention Self 2024-04-20 11:39:43 -04:00
higher-ranked.rs
higher-ranked.stderr
ordering.rs Some ordering and duplication checks 2024-04-15 16:45:26 -04:00
ordering.stderr Some ordering and duplication checks 2024-04-15 16:45:26 -04:00
outlives.rs
outlives.stderr
self-capture.rs Add hir::Node::PreciseCapturingNonLifetimeArg 2024-04-15 16:45:25 -04:00
self-capture.stderr Add hir::Node::PreciseCapturingNonLifetimeArg 2024-04-15 16:45:25 -04:00
unexpected-token.rs Don't fatal when calling expect_one_of when recovering arg in parse_seq 2024-04-19 13:12:20 -04:00
unexpected-token.stderr Don't fatal when calling expect_one_of when recovering arg in parse_seq 2024-04-19 13:12:20 -04:00