Skip to content

Commit de0feb3

Browse files
authored
Rollup merge of rust-lang#93910 - rosehuds:master, r=cjgillot
fix mention of moved function in `rustc_hir` docs The function was moved from `Crate` to `Map` in db9fea5 but these docs weren't updated
2 parents 0986b2d + 45dc8eb commit de0feb3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_hir/src/itemlikevisit.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)