about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-02-12 11:48:53 +0000
committerbors <bors@rust-lang.org>2022-02-12 11:48:53 +0000
commitf8f175199e8db959cf25f1582157ca89ecf6210a (patch)
treee97706832717d66ab32f137f22edc560688bd472 /compiler/rustc_parse/src/parser
parent9cdefd763b910ffd1d42233a8c752ab5fd84ca4d (diff)
parent0e3ecd28fd6b3671b62e91661797f20a3f9c7deb (diff)
downloadrust-f8f175199e8db959cf25f1582157ca89ecf6210a.tar.gz
rust-f8f175199e8db959cf25f1582157ca89ecf6210a.zip
Auto merge of #93933 - matthiaskrgr:rollup-1hjae6g, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #91908 (Add 2 tests)
 - #93595 (fix ICE when parsing lifetime as function argument)
 - #93757 (Add some known GAT bugs as tests)
 - #93759 (Pretty print ItemKind::Use in rustfmt style)
 - #93897 (linkchecker: fix panic on directory symlinks)
 - #93898 (tidy: Extend error code check)
 - #93928 (Add missing release notes for #85200)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 4898a4844b9..e9aa4adcaf7 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -1457,9 +1457,9 @@ impl<'a> Parser<'a> {
         } else if self.check(&token::OpenDelim(token::Brace)) || self.token.is_whole_block() {
             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, and the "expected one of" error.
-            self.diagnostic().delay_span_bug(lo, "this label wasn't parsed correctly");
+            // We're probably inside of a `Path<'a>` that needs a turbofish
+            let msg = "expected `while`, `for`, `loop` or `{` after a label";
+            self.struct_span_err(self.token.span, msg).span_label(self.token.span, msg).emit();
             consume_colon = false;
             Ok(self.mk_expr_err(lo))
         } else {