Skip to content

Commit 1b2a422

Browse files
committed
Simplify check_decl_no_pat.
1 parent 41601a8 commit 1b2a422

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)