From 054458b48db87ce767d7cc3d2dd86846ada3e3da Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Wed, 11 Dec 2019 11:14:13 +0100 Subject: [PATCH] make visitor uses more robust --- src/librustc/hir/lowering/item.rs | 4 ++-- src/librustc_resolve/late.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc/hir/lowering/item.rs b/src/librustc/hir/lowering/item.rs index f0543b9057d1f..46c944fa67881 100644 --- a/src/librustc/hir/lowering/item.rs +++ b/src/librustc/hir/lowering/item.rs @@ -94,7 +94,7 @@ impl<'tcx, 'interner> Visitor<'tcx> for ItemLowerer<'tcx, 'interner> { lctx.modules.get_mut(&lctx.current_module).unwrap().trait_items.insert(id); }); - visit::walk_assoc_item(self, item); + visit::walk_trait_item(self, item); } fn visit_impl_item(&mut self, item: &'tcx AssocItem) { @@ -104,7 +104,7 @@ impl<'tcx, 'interner> Visitor<'tcx> for ItemLowerer<'tcx, 'interner> { lctx.impl_items.insert(id, hir_item); lctx.modules.get_mut(&lctx.current_module).unwrap().impl_items.insert(id); }); - visit::walk_assoc_item(self, item); + visit::walk_impl_item(self, item); } } diff --git a/src/librustc_resolve/late.rs b/src/librustc_resolve/late.rs index ec9c2a5b75d83..4321f62e03bc8 100644 --- a/src/librustc_resolve/late.rs +++ b/src/librustc_resolve/late.rs @@ -819,10 +819,10 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> { } } AssocItemKind::Fn(_, _) => { - visit::walk_assoc_item(this, trait_item) + visit::walk_trait_item(this, trait_item) } AssocItemKind::TyAlias(..) => { - visit::walk_assoc_item(this, trait_item) + visit::walk_trait_item(this, trait_item) } AssocItemKind::Macro(_) => { panic!("unexpanded macro in resolve!") @@ -1106,7 +1106,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> { ); this.with_constant_rib(|this| { - visit::walk_assoc_item(this, impl_item) + visit::walk_impl_item(this, impl_item) }); } AssocItemKind::Fn(..) => { @@ -1117,7 +1117,7 @@ impl<'a, 'b> LateResolutionVisitor<'a, '_> { impl_item.span, |n, s| MethodNotMemberOfTrait(n, s)); - visit::walk_assoc_item(this, impl_item); + visit::walk_impl_item(this, impl_item); } AssocItemKind::TyAlias(_, Some(ref ty)) => { // If this is a trait impl, ensure the type