diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-10-21 14:11:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-21 14:11:08 +0900 |
| commit | afdd0c3adedd5839e6d89a6d5ae8d0acfee0aae7 (patch) | |
| tree | 4996d8318dbf18d07f0c91679eefcaa12c17a204 /compiler/rustc_const_eval/src/const_eval | |
| parent | 47a1f67a8d953f0c1c76f5cabed5d92df30eb512 (diff) | |
| parent | 6e98688e68affa283b8edeb8c61958436c74c1aa (diff) | |
| download | rust-afdd0c3adedd5839e6d89a6d5ae8d0acfee0aae7.tar.gz rust-afdd0c3adedd5839e6d89a6d5ae8d0acfee0aae7.zip | |
Rollup merge of #90071 - cjgillot:no-blocks, r=oli-obk
Remove hir::map::blocks and use FnKind instead The principal tool is `FnLikeNode`, which is not often used and can be easily implemented using `rustc_hir::intravisit::FnKind`.
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/fn_queries.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs index df4cc295fac..80551518d3c 100644 --- a/compiler/rustc_const_eval/src/const_eval/fn_queries.rs +++ b/compiler/rustc_const_eval/src/const_eval/fn_queries.rs @@ -1,6 +1,5 @@ use rustc_hir as hir; use rustc_hir::def_id::DefId; -use rustc_middle::hir::map::blocks::FnLikeNode; use rustc_middle::ty::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_span::symbol::Symbol; @@ -44,8 +43,8 @@ fn is_const_fn_raw(tcx: TyCtxt<'_>, def_id: DefId) -> bool { } else { false } - } else if let Some(fn_like) = FnLikeNode::from_node(node) { - if fn_like.constness() == hir::Constness::Const { + } else if let Some(fn_kind) = node.fn_kind() { + if fn_kind.constness() == hir::Constness::Const { return true; } |
