diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-10-19 23:31:51 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-10-19 23:31:51 +0200 |
| commit | 6e98688e68affa283b8edeb8c61958436c74c1aa (patch) | |
| tree | ddd927b4a0af74a543b892622f80fe27ecf7303b /compiler/rustc_mir_build/src/lints.rs | |
| parent | 05eb6f36f1e17aa00ef286c2dacc9d890fdc899c (diff) | |
| download | rust-6e98688e68affa283b8edeb8c61958436c74c1aa.tar.gz rust-6e98688e68affa283b8edeb8c61958436c74c1aa.zip | |
Replace FnLikeNode by FnKind.
Diffstat (limited to 'compiler/rustc_mir_build/src/lints.rs')
| -rw-r--r-- | compiler/rustc_mir_build/src/lints.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_mir_build/src/lints.rs b/compiler/rustc_mir_build/src/lints.rs index ef8bd20d510..e4c2d2dce67 100644 --- a/compiler/rustc_mir_build/src/lints.rs +++ b/compiler/rustc_mir_build/src/lints.rs @@ -2,7 +2,6 @@ use rustc_data_structures::graph::iterate::{ NodeStatus, TriColorDepthFirstSearch, TriColorVisitor, }; use rustc_hir::intravisit::FnKind; -use rustc_middle::hir::map::blocks::FnLikeNode; use rustc_middle::mir::{BasicBlock, Body, Operand, TerminatorKind}; use rustc_middle::ty::subst::{GenericArg, InternalSubsts}; use rustc_middle::ty::{self, AssocItem, AssocItemContainer, Instance, TyCtxt}; @@ -14,8 +13,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_like_node) = FnLikeNode::from_node(tcx.hir().get(hir_id)) { - if let FnKind::Closure = fn_like_node.kind() { + if let Some(fn_kind) = tcx.hir().get(hir_id).fn_kind() { + if let FnKind::Closure = fn_kind { // closures can't recur, so they don't matter. return; } |
