Skip to content

Commit a0e00f8

Browse files
authored
Rollup merge of rust-lang#67115 - Centril:simplify-check-decl-no-pat, r=davidtwco
Simplify `check_decl_no_pat`. r? @davidtwco
2 parents 3340a5b + 1b2a422 commit a0e00f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_passes/ast_validation.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ impl<'a> AstValidator<'a> {
158158
err.emit();
159159
}
160160

161-
fn check_decl_no_pat<F: FnMut(Span, bool)>(decl: &FnDecl, mut report_err: F) {
162-
for arg in &decl.inputs {
163-
match arg.pat.kind {
161+
fn check_decl_no_pat(decl: &FnDecl, mut report_err: impl FnMut(Span, bool)) {
162+
for Param { pat, .. } in &decl.inputs {
163+
match pat.kind {
164164
PatKind::Ident(BindingMode::ByValue(Mutability::Immutable), _, None) |
165165
PatKind::Wild => {}
166166
PatKind::Ident(BindingMode::ByValue(Mutability::Mutable), _, None) =>
167-
report_err(arg.pat.span, true),
168-
_ => report_err(arg.pat.span, false),
167+
report_err(pat.span, true),
168+
_ => report_err(pat.span, false),
169169
}
170170
}
171171
}

0 commit comments

Comments
 (0)