1
Fork 0

Disallow arm bodies on never patterns

This commit is contained in:
Nadrieril 2023-11-27 04:08:09 +01:00
parent 06a8ed10b6
commit 70deb9a57f
8 changed files with 75 additions and 26 deletions

View file

@ -349,6 +349,15 @@ pub struct MatchArmWithNoBody {
pub suggestion: Span,
}
#[derive(Diagnostic)]
#[diag(ast_lowering_never_pattern_with_body)]
pub struct NeverPatternWithBody {
#[primary_span]
#[label]
#[suggestion(code = "", applicability = "maybe-incorrect")]
pub span: Span,
}
#[derive(Diagnostic)]
#[diag(ast_lowering_never_pattern_with_guard)]
pub struct NeverPatternWithGuard {