Skip to content

Commit 3168023

Browse files
committed
Rustup
1 parent 9d5b148 commit 3168023

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/arithmetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
128128
}
129129
self.const_span = Some(body_span);
130130
},
131-
hir::BodyOwnerKind::Fn => (),
131+
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => (),
132132
}
133133
}
134134

clippy_lints/src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub fn differing_macro_contexts(lhs: Span, rhs: Span) -> bool {
6565
pub fn in_constant(cx: &LateContext<'_, '_>, id: NodeId) -> bool {
6666
let parent_id = cx.tcx.hir().get_parent(id);
6767
match cx.tcx.hir().body_owner_kind(parent_id) {
68-
hir::BodyOwnerKind::Fn => false,
68+
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => false,
6969
hir::BodyOwnerKind::Const | hir::BodyOwnerKind::Static(..) => true,
7070
}
7171
}

0 commit comments

Comments
 (0)