@@ -8,7 +8,7 @@ use super::{ForeignItem, ImplItem, Item, TraitItem};
88///
99/// 1. **Shallow visit**: Get a simple callback for every item (or item-like thing) in the HIR.
1010/// - Example: find all items with a `#[foo]` attribute on them.
11- /// - How: Implement `ItemLikeVisitor` and call `tcx.hir().krate(). visit_all_item_likes()`.
11+ /// - How: Implement `ItemLikeVisitor` and call `tcx.hir().visit_all_item_likes()`.
1212/// - Pro: Efficient; just walks the lists of item-like things, not the nodes themselves.
1313/// - Con: Don't get information about nesting
1414/// - Con: Don't have methods for specific bits of HIR, like "on
@@ -19,9 +19,9 @@ use super::{ForeignItem, ImplItem, Item, TraitItem};
1919/// - Example: Examine each expression to look for its type and do some check or other.
2020/// - How: Implement `intravisit::Visitor` and override the `nested_visit_map()` method
2121/// to return `NestedVisitorMap::OnlyBodies` and use
22- /// `tcx.hir().krate(). visit_all_item_likes(&mut visitor.as_deep_visitor())`. Within
23- /// your `intravisit::Visitor` impl, implement methods like `visit_expr()` (don't forget
24- /// to invoke `intravisit::walk_expr()` to keep walking the subparts).
22+ /// `tcx.hir().visit_all_item_likes(&mut visitor.as_deep_visitor())`. Within your
23+ /// `intravisit::Visitor` impl, implement methods like `visit_expr()` (don't forget to invoke
24+ /// `intravisit::walk_expr()` to keep walking the subparts).
2525/// - Pro: Visitor methods for any kind of HIR node, not just item-like things.
2626/// - Pro: Integrates well into dependency tracking.
2727/// - Con: Don't get information about nesting between items
0 commit comments