From 24f009c5e55d18c12563dd74681ca33b8a349936 Mon Sep 17 00:00:00 2001 From: zetanumbers Date: Fri, 1 Dec 2023 05:28:34 -0800 Subject: 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 Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id` --- compiler/rustc_incremental/src/persist/dirty_clean.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_incremental') diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs index 0f2194139df..8a7b97139ea 100644 --- a/compiler/rustc_incremental/src/persist/dirty_clean.rs +++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs @@ -232,7 +232,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> { /// Return all DepNode labels that should be asserted for this item. /// index=0 is the "name" used for error messages fn auto_labels(&mut self, item_id: LocalDefId, attr: &Attribute) -> (&'static str, Labels) { - let node = self.tcx.hir().get_by_def_id(item_id); + let node = self.tcx.hir_node_by_def_id(item_id); let (name, labels) = match node { HirNode::Item(item) => { match item.kind { -- cgit 1.4.1-3-g733a5