Skip to content

Commit d55843f

Browse files
committed
Don't lint closures in arg_iter
1 parent 6fffc89 commit d55843f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • examples/supplementary/arg_iter/src

examples/supplementary/arg_iter/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,16 @@ impl<'tcx> LateLintPass<'tcx> for ArgIter {
6565
fn check_fn(
6666
&mut self,
6767
cx: &LateContext<'tcx>,
68-
_kind: FnKind<'tcx>,
68+
kind: FnKind<'tcx>,
6969
decl: &'tcx FnDecl<'tcx>,
7070
_body: &'tcx Body<'tcx>,
7171
span: Span,
7272
id: LocalDefId,
7373
) {
74+
if matches!(kind, FnKind::Closure) {
75+
return;
76+
}
77+
7478
// Don't lint functions generated by macros (e.g. derive, attribute macros)
7579
if span.from_expansion() {
7680
return;

0 commit comments

Comments
 (0)