about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-11-18 14:13:36 +0100
committerGitHub <noreply@github.com>2022-11-18 14:13:36 +0100
commit3efbf3022012f3dbebd6743bf8e53f50cb1d0488 (patch)
tree34f9c9a4d5c5c3f7d8901f2963fa1a77d8097ef2 /compiler/rustc_parse/src/errors.rs
parent741f3cf38331d4644b89d52f54c2683c17f54670 (diff)
parentcd2bde19551234799cd3df3231fb658707b04195 (diff)
downloadrust-3efbf3022012f3dbebd6743bf8e53f50cb1d0488.tar.gz
rust-3efbf3022012f3dbebd6743bf8e53f50cb1d0488.zip
Rollup merge of #103405 - chenyukang:yukang/fix-103381-and-if, r=compiler-errors
Detect incorrect chaining of if and if let conditions and recover

Fixes #103381
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 724d92254a4..211450250fd 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -1219,3 +1219,11 @@ pub(crate) struct FnPtrWithGenericsSugg {
     pub arity: usize,
     pub for_param_list_exists: bool,
 }
+
+#[derive(Diagnostic)]
+#[diag(parser_unexpected_if_with_if)]
+pub(crate) struct UnexpectedIfWithIf(
+    #[primary_span]
+    #[suggestion(applicability = "machine-applicable", code = " ", style = "verbose")]
+    pub Span,
+);