]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_build/src/lints.rs
Rollup merge of #92835 - iwanders:issue-66450-improve-cfg-error-message, r=nagisa
[rust.git] / compiler / rustc_mir_build / src / lints.rs
index e4c2d2dce67c7d3883b5614c3e23599a74626e59..d348aaa899e65d79d78b950bb8d3bd196cd231c5 100644 (file)
@@ -11,9 +11,8 @@
 
 crate fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
     let def_id = body.source.def_id().expect_local();
-    let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
 
-    if let Some(fn_kind) = tcx.hir().get(hir_id).fn_kind() {
+    if let Some(fn_kind) = tcx.hir().get_by_def_id(def_id).fn_kind() {
         if let FnKind::Closure = fn_kind {
             // closures can't recur, so they don't matter.
             return;