summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_passes/src/reachable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_passes/src/reachable.rs')
-rw-r--r--compiler/rustc_passes/src/reachable.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_passes/src/reachable.rs b/compiler/rustc_passes/src/reachable.rs
index 650bb97c4..f46f831dd 100644
--- a/compiler/rustc_passes/src/reachable.rs
+++ b/compiler/rustc_passes/src/reachable.rs
@@ -115,7 +115,7 @@ impl<'tcx> ReachableContext<'tcx> {
return false;
};
- match self.tcx.hir().find_by_def_id(def_id) {
+ match self.tcx.opt_hir_node_by_def_id(def_id) {
Some(Node::Item(item)) => match item.kind {
hir::ItemKind::Fn(..) => item_might_be_inlined(self.tcx, def_id.into()),
_ => false,
@@ -146,7 +146,7 @@ impl<'tcx> ReachableContext<'tcx> {
continue;
}
- if let Some(ref item) = self.tcx.hir().find_by_def_id(search_item) {
+ if let Some(ref item) = self.tcx.opt_hir_node_by_def_id(search_item) {
self.propagate_node(item, search_item);
}
}
@@ -260,9 +260,7 @@ impl<'tcx> ReachableContext<'tcx> {
_ => {
bug!(
"found unexpected node kind in worklist: {} ({:?})",
- self.tcx
- .hir()
- .node_to_string(self.tcx.hir().local_def_id_to_hir_id(search_item)),
+ self.tcx.hir().node_to_string(self.tcx.local_def_id_to_hir_id(search_item)),
node,
);
}