1
Fork 0

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
This commit is contained in:
Matthias Krüger 2022-11-18 14:13:36 +01:00 committed by GitHub
commit 3efbf30220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 192 additions and 2 deletions

View file

@ -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,
);