Move some methods from tcx.hir() to tcx
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
This commit is contained in:
@@ -50,7 +50,7 @@ impl<'tcx> MirPass<'tcx> for InstrumentCoverage {
|
||||
}
|
||||
|
||||
let is_fn_like =
|
||||
tcx.hir().get_by_def_id(mir_source.def_id().expect_local()).fn_kind().is_some();
|
||||
tcx.hir_node_by_def_id(mir_source.def_id().expect_local()).fn_kind().is_some();
|
||||
|
||||
// Only instrument functions, methods, and closures (not constants since they are evaluated
|
||||
// at compile time by Miri).
|
||||
|
||||
Reference in New Issue
Block a user