]> git.lizzy.rs Git - rust.git/blobdiff - clippy_utils/src/lib.rs
Change enclosing_body_owner to return LocalDefId
[rust.git] / clippy_utils / src / lib.rs
index 34a1cdaf1d52a52fd882a48609e257c6ad654fc7..50bb008098dcbc16c674ee49d0cae5d2de32cfdc 100644 (file)
@@ -1353,7 +1353,7 @@ pub fn is_integer_const(cx: &LateContext<'_>, e: &Expr<'_>, value: u128) -> bool
     if is_integer_literal(e, value) {
         return true;
     }
-    let enclosing_body = cx.tcx.hir().local_def_id(cx.tcx.hir().enclosing_body_owner(e.hir_id));
+    let enclosing_body = cx.tcx.hir().enclosing_body_owner(e.hir_id);
     if let Some((Constant::Int(v), _)) = constant(cx, cx.tcx.typeck(enclosing_body), e) {
         return value == v;
     }