Skip to content

Commit

Permalink
Rollup merge of rust-lang#67115 - Centril:simplify-check-decl-no-pat,…
Browse files Browse the repository at this point in the history
… r=davidtwco

Simplify `check_decl_no_pat`.

r? @davidtwco
  • Loading branch information
tmandry authored Dec 9, 2019
2 parents 3340a5b + 1b2a422 commit a0e00f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/librustc_passes/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ impl<'a> AstValidator<'a> {
err.emit();
}

fn check_decl_no_pat<F: FnMut(Span, bool)>(decl: &FnDecl, mut report_err: F) {
for arg in &decl.inputs {
match arg.pat.kind {
fn check_decl_no_pat(decl: &FnDecl, mut report_err: impl FnMut(Span, bool)) {
for Param { pat, .. } in &decl.inputs {
match pat.kind {
PatKind::Ident(BindingMode::ByValue(Mutability::Immutable), _, None) |
PatKind::Wild => {}
PatKind::Ident(BindingMode::ByValue(Mutability::Mutable), _, None) =>
report_err(arg.pat.span, true),
_ => report_err(arg.pat.span, false),
report_err(pat.span, true),
_ => report_err(pat.span, false),
}
}
}
Expand Down

0 comments on commit a0e00f8

Please sign in to comment.