Skip to content

Commit

Permalink
make visitor uses more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Dec 12, 2019
1 parent 74d4fbc commit 054458b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/librustc/hir/lowering/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/librustc_resolve/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down Expand Up @@ -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(..) => {
Expand All @@ -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
Expand Down

0 comments on commit 054458b

Please sign in to comment.