Skip to content

Commit

Permalink
Rollup merge of #93910 - rosehuds:master, r=cjgillot
Browse files Browse the repository at this point in the history
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
  • Loading branch information
matthiaskrgr authored Feb 11, 2022
2 parents d74690d + 45dc8eb commit c06cc03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_hir/src/itemlikevisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{ForeignItem, ImplItem, Item, TraitItem};
///
/// 1. **Shallow visit**: Get a simple callback for every item (or item-like thing) in the HIR.
/// - Example: find all items with a `#[foo]` attribute on them.
/// - How: Implement `ItemLikeVisitor` and call `tcx.hir().krate().visit_all_item_likes()`.
/// - How: Implement `ItemLikeVisitor` and call `tcx.hir().visit_all_item_likes()`.
/// - Pro: Efficient; just walks the lists of item-like things, not the nodes themselves.
/// - Con: Don't get information about nesting
/// - Con: Don't have methods for specific bits of HIR, like "on
Expand All @@ -19,9 +19,9 @@ use super::{ForeignItem, ImplItem, Item, TraitItem};
/// - Example: Examine each expression to look for its type and do some check or other.
/// - How: Implement `intravisit::Visitor` and override the `nested_visit_map()` method
/// to return `NestedVisitorMap::OnlyBodies` and use
/// `tcx.hir().krate().visit_all_item_likes(&mut visitor.as_deep_visitor())`. Within
/// your `intravisit::Visitor` impl, implement methods like `visit_expr()` (don't forget
/// to invoke `intravisit::walk_expr()` to keep walking the subparts).
/// `tcx.hir().visit_all_item_likes(&mut visitor.as_deep_visitor())`. Within your
/// `intravisit::Visitor` impl, implement methods like `visit_expr()` (don't forget to invoke
/// `intravisit::walk_expr()` to keep walking the subparts).
/// - Pro: Visitor methods for any kind of HIR node, not just item-like things.
/// - Pro: Integrates well into dependency tracking.
/// - Con: Don't get information about nesting between items
Expand Down

0 comments on commit c06cc03

Please sign in to comment.