1
Fork 0

Auto merge of #96531 - kckeiks:remove-item-like-visitor-from-rustc-typeck, r=cjgillot

Remove ItemLikeVisitor impls from rustc_typeck

Issue #95004
cc `@cjgillot`
This commit is contained in:
bors 2022-05-07 01:59:11 +00:00
commit f6e5570460
23 changed files with 512 additions and 553 deletions

View file

@ -308,11 +308,6 @@ impl<'hir> Map<'hir> {
Some(def_kind)
}
pub fn def_kind(self, local_def_id: LocalDefId) -> DefKind {
self.opt_def_kind(local_def_id)
.unwrap_or_else(|| bug!("def_kind: unsupported node: {:?}", local_def_id))
}
pub fn find_parent_node(self, id: HirId) -> Option<HirId> {
if id.local_id == ItemLocalId::from_u32(0) {
Some(self.tcx.hir_owner_parent(id.owner))

View file

@ -2676,7 +2676,7 @@ fn for_each_def(tcx: TyCtxt<'_>, mut collect_fn: impl for<'b> FnMut(&'b Ident, N
// Iterate all local crate items no matter where they are defined.
let hir = tcx.hir();
for id in hir.items() {
if matches!(hir.def_kind(id.def_id), DefKind::Use) {
if matches!(tcx.def_kind(id.def_id), DefKind::Use) {
continue;
}