Disallow an arm without a body (except for never patterns)
Parsing now accepts a match arm without a body, so we must make sure to only accept that if the pattern is a never pattern.
This commit is contained in:
parent
0bfebc6105
commit
a2dcb3a6d9
9 changed files with 128 additions and 12 deletions
|
@ -340,6 +340,15 @@ pub struct NotSupportedForLifetimeBinderAsyncClosure {
|
|||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(ast_lowering_match_arm_with_no_body)]
|
||||
pub struct MatchArmWithNoBody {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[suggestion(code = " => todo!(),", applicability = "has-placeholders")]
|
||||
pub suggestion: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic, Clone, Copy)]
|
||||
#[diag(ast_lowering_arbitrary_expression_in_pattern)]
|
||||
pub struct ArbitraryExpressionInPattern {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue