]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/operators/numeric_arithmetic.rs
Take a LocalDefId in hir::Visitor::visit_fn.
[rust.git] / src / tools / clippy / clippy_lints / src / operators / numeric_arithmetic.rs
index 0830a106f55685014b50e19476296bddf8397519..777395f452c92397e47a9caeeee568184e3d6ed6 100644 (file)
@@ -96,7 +96,7 @@ pub fn expr_post(&mut self, id: hir::HirId) {
 
     pub fn enter_body(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) {
         let body_owner = cx.tcx.hir().body_owner(body.id());
-        let body_owner_def_id = cx.tcx.hir().local_def_id(body_owner);
+        let body_owner_def_id = cx.tcx.hir().body_owner_def_id(body.id());
 
         match cx.tcx.hir().body_owner_kind(body_owner_def_id) {
             hir::BodyOwnerKind::Static(_) | hir::BodyOwnerKind::Const => {