diff options
| author | Miguel Guarniz <mi9uel9@gmail.com> | 2022-04-29 13:11:22 -0400 |
|---|---|---|
| committer | Miguel Guarniz <mi9uel9@gmail.com> | 2022-05-06 12:11:05 -0400 |
| commit | 3afc5ea2010342f38fa771e9b81438249416f252 (patch) | |
| tree | f6e075c29f035dfaf7fbb0f1c4e4381e2bd50be5 /compiler/rustc_monomorphize | |
| parent | ef1d1120953fb7a20f22fb70800cf9b76ce54077 (diff) | |
use def_span and def_kind queries instead of calling tcx.hir() methods
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
Diffstat (limited to 'compiler/rustc_monomorphize')
| -rw-r--r-- | compiler/rustc_monomorphize/src/collector.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 1828aecb375..c557b7c359b 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -1167,7 +1167,7 @@ struct RootCollector<'a, 'tcx> { impl<'v> RootCollector<'_, 'v> { fn process_item(&mut self, id: hir::ItemId) { - match self.tcx.hir().def_kind(id.def_id) { + match self.tcx.def_kind(id.def_id) { DefKind::Enum | DefKind::Struct | DefKind::Union => { let item = self.tcx.hir().item(id); match item.kind { @@ -1228,7 +1228,7 @@ impl<'v> RootCollector<'_, 'v> { } fn process_impl_item(&mut self, id: hir::ImplItemId) { - if matches!(self.tcx.hir().def_kind(id.def_id), DefKind::AssocFn) { + if matches!(self.tcx.def_kind(id.def_id), DefKind::AssocFn) { self.push_if_root(id.def_id); } } |
