about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authory21 <30553356+y21@users.noreply.github.com>2023-02-23 20:12:01 +0100
committery21 <30553356+y21@users.noreply.github.com>2023-03-01 13:26:59 +0100
commit0758c05c9792700dbc482eda8cd464c39d5ebed5 (patch)
treea6df85d272161a11a4945c2a3d730a39364f6d3d /compiler/rustc_parse/src/errors.rs
parent64165aac68af780182ff89a6eb3982e3c262266e (diff)
downloadrust-0758c05c9792700dbc482eda8cd464c39d5ebed5.tar.gz
rust-0758c05c9792700dbc482eda8cd464c39d5ebed5.zip
recover from for-else and while-else
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index c746a870964..1662db36d10 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -452,6 +452,17 @@ pub(crate) struct MissingExpressionInForLoop {
 }
 
 #[derive(Diagnostic)]
+#[diag(parse_loop_else)]
+#[note]
+pub(crate) struct LoopElseNotSupported {
+    #[primary_span]
+    pub span: Span,
+    pub loop_kind: &'static str,
+    #[label(parse_loop_keyword)]
+    pub loop_kw: Span,
+}
+
+#[derive(Diagnostic)]
 #[diag(parse_missing_comma_after_match_arm)]
 pub(crate) struct MissingCommaAfterMatchArm {
     #[primary_span]