]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/operators/arithmetic_side_effects.rs
Auto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin
[rust.git] / src / tools / clippy / clippy_lints / src / operators / arithmetic_side_effects.rs
index cff82b875f11a73830cf2ab574593664030ac9f2..d592f6e814c1d3599ceb0dcdac485a729d7d2c6b 100644 (file)
@@ -209,7 +209,8 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &hir::Expr<'tcx>) {
 
     fn check_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());
+
         let body_owner_kind = cx.tcx.hir().body_owner_kind(body_owner_def_id);
         if let hir::BodyOwnerKind::Const | hir::BodyOwnerKind::Static(_) = body_owner_kind {
             let body_span = cx.tcx.hir().span_with_body(body_owner);