about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-25 23:06:04 +0100
committerGitHub <noreply@github.com>2022-01-25 23:06:04 +0100
commit086be2b6c430386f86b00624d4e536e972fcdbb1 (patch)
treeff1327687a5b2cfaf76fd3a7990072a9fb6c8365 /compiler/rustc_parse/src/parser/expr.rs
parent04f915b33258c98fe8a5061369a7d924e3d2328a (diff)
parent37bed05986db600d6d8028af981632138dd7c7b2 (diff)
downloadrust-086be2b6c430386f86b00624d4e536e972fcdbb1.tar.gz
rust-086be2b6c430386f86b00624d4e536e972fcdbb1.zip
Rollup merge of #93303 - compiler-errors:issue-93282, r=wesleywiser
Fix ICE when parsing bad turbofish with lifetime argument

Generalize conditions where we suggest adding the turbofish operator, so we don't ICE during code like

```rust
fn foo() {
  A<'a,>
}
```

but instead suggest adding a turbofish.

Fixes #93282
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 26284728ff2..693dd0051da 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -1458,7 +1458,7 @@ impl<'a> Parser<'a> {
             self.parse_block_expr(label, lo, BlockCheckMode::Default, attrs)
         } else if !ate_colon && (self.check(&TokenKind::Comma) || self.check(&TokenKind::Gt)) {
             // We're probably inside of a `Path<'a>` that needs a turbofish, so suppress the
-            // "must be followed by a colon" error.
+            // "must be followed by a colon" error, and the "expected one of" error.
             self.diagnostic().delay_span_bug(lo, "this label wasn't parsed correctly");
             consume_colon = false;
             Ok(self.mk_expr_err(lo))