about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-02-05 20:33:05 +0000
committerbors <bors@rust-lang.org>2023-02-05 20:33:05 +0000
commit75a0be98f25a4b9de5afa0e15eb016e7f9627032 (patch)
tree7f417a69f7d64017ffabc3291f6d8adafbdad700 /compiler/rustc_parse/src/errors.rs
parenta67649675014546ce454d65bc8fe3ebd18e6a319 (diff)
parent17b6bd6b70fd49c034b32b5b9b2869d139ed4d46 (diff)
downloadrust-75a0be98f25a4b9de5afa0e15eb016e7f9627032.tar.gz
rust-75a0be98f25a4b9de5afa0e15eb016e7f9627032.zip
Auto merge of #107526 - obeis:for-missing-iterator, r=estebank,compiler-errors
Recover form missing expression in `for` loop

Close #78537
r? `@estebank`
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index fd4333dbbec..fc7c839f1c4 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -434,6 +434,18 @@ pub(crate) enum MissingInInForLoopSub {
 }
 
 #[derive(Diagnostic)]
+#[diag(parse_missing_expression_in_for_loop)]
+pub(crate) struct MissingExpressionInForLoop {
+    #[primary_span]
+    #[suggestion(
+        code = "/* expression */ ",
+        applicability = "has-placeholders",
+        style = "verbose"
+    )]
+    pub span: Span,
+}
+
+#[derive(Diagnostic)]
 #[diag(parse_missing_comma_after_match_arm)]
 pub(crate) struct MissingCommaAfterMatchArm {
     #[primary_span]