]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/arithmetic.rs
Rollup merge of #96336 - Nilstrieb:link-to-correct-as_mut-in-ptr-as_ref, r=JohnTitor
[rust.git] / src / tools / clippy / clippy_lints / src / arithmetic.rs
index e0c1d6ab6e12235577859c606f9e572dcbaf9f0f..c5948707c812448d88a8ec9c45eb7c97c31f4bb3 100644 (file)
@@ -139,11 +139,11 @@ fn check_expr_post(&mut self, _: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>)
     }
 
     fn check_body(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) {
-        let body_owner = cx.tcx.hir().body_owner(body.id());
+        let body_owner = cx.tcx.hir().body_owner_def_id(body.id());
 
         match cx.tcx.hir().body_owner_kind(body_owner) {
             hir::BodyOwnerKind::Static(_) | hir::BodyOwnerKind::Const => {
-                let body_span = cx.tcx.hir().span(body_owner);
+                let body_span = cx.tcx.def_span(body_owner);
 
                 if let Some(span) = self.const_span {
                     if span.contains(body_span) {