Skip to content

Commit

Permalink
Rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 22, 2019
1 parent 9d5b148 commit 3168023
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
}
self.const_span = Some(body_span);
},
hir::BodyOwnerKind::Fn => (),
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => (),
}
}

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub fn differing_macro_contexts(lhs: Span, rhs: Span) -> bool {
pub fn in_constant(cx: &LateContext<'_, '_>, id: NodeId) -> bool {
let parent_id = cx.tcx.hir().get_parent(id);
match cx.tcx.hir().body_owner_kind(parent_id) {
hir::BodyOwnerKind::Fn => false,
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => false,
hir::BodyOwnerKind::Const | hir::BodyOwnerKind::Static(..) => true,
}
}
Expand Down

0 comments on commit 3168023

Please sign in to comment.