Refactor and re-use BindingAnnotation
This commit is contained in:
parent
9353538c7b
commit
02ba216e3c
25 changed files with 176 additions and 225 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue