Replace FnLikeNode by FnKind.
This commit is contained in:
parent
05eb6f36f1
commit
6e98688e68
11 changed files with 47 additions and 102 deletions
|
@ -68,11 +68,10 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
|
|||
return;
|
||||
}
|
||||
|
||||
use rustc_middle::hir::map::blocks::FnLikeNode;
|
||||
let def_id = body.source.def_id().expect_local();
|
||||
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
|
||||
let is_fn_like = FnLikeNode::from_node(tcx.hir().get(hir_id)).is_some();
|
||||
let is_fn_like = tcx.hir().get(hir_id).fn_kind().is_some();
|
||||
let is_assoc_const = tcx.def_kind(def_id.to_def_id()) == DefKind::AssocConst;
|
||||
|
||||
// Only run const prop on functions, methods, closures and associated constants
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue