Refactor and re-use BindingAnnotation
This commit is contained in:
@@ -281,8 +281,8 @@ impl<'a> AstValidator<'a> {
|
||||
fn check_decl_no_pat(decl: &FnDecl, mut report_err: impl FnMut(Span, Option<Ident>, bool)) {
|
||||
for Param { pat, .. } in &decl.inputs {
|
||||
match pat.kind {
|
||||
PatKind::Ident(BindingMode::ByValue(Mutability::Not), _, None) | PatKind::Wild => {}
|
||||
PatKind::Ident(BindingMode::ByValue(Mutability::Mut), ident, None) => {
|
||||
PatKind::Ident(BindingAnnotation::NONE, _, None) | PatKind::Wild => {}
|
||||
PatKind::Ident(BindingAnnotation::MUT, ident, None) => {
|
||||
report_err(pat.span, Some(ident), true)
|
||||
}
|
||||
_ => report_err(pat.span, None, false),
|
||||
|
||||
Reference in New Issue
Block a user