rust/compiler/rustc_parse/src
许杰友 Jieyou Xu (Joe) e7bb090d0a
Rollup merge of #124930 - compiler-errors:consume-arg, r=petrochenkov
Make sure we consume a generic arg when checking mistyped turbofish

When recovering un-turbofish-ed args in expr position (e.g. `let x = a<T, U>();` in `check_mistyped_turbofish_with_multiple_type_params`, we used `parse_seq_to_before_end` to parse the fake generic args; however, it used `parse_generic_arg` which *optionally* parses a generic arg. If it doesn't end up parsing an arg, it returns `Ok(None)` and consumes no tokens. If we don't find a delimiter after this (`,`), we try parsing *another* element. In this case, we just infinitely loop looking for a subsequent element.

We can fix this by making sure that we either parse a generic arg or error in `parse_seq_to_before_end`'s callback.

Fixes #124897
2024-05-11 01:15:10 +01:00
..
lexer narrow down visibilities in rustc_parse::lexer 2024-05-07 11:02:28 +08:00
parser Rollup merge of #124930 - compiler-errors:consume-arg, r=petrochenkov 2024-05-11 01:15:10 +01:00
errors.rs Fix parse error message for meta items 2024-05-10 09:16:27 +02:00
lib.rs compiler: add Parser::debug_lookahead 2024-05-07 19:10:29 -07:00
validate_attr.rs Rename all ParseSess variables/fields/lifetimes as psess. 2024-03-05 08:11:45 +11:00