diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-11 21:48:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-11 21:48:52 +0100 |
| commit | de0feb30bd54fe26e1bb2a0a75ea519708ab8f76 (patch) | |
| tree | 1fbea76d4a158f00d9331e69dda314c2b0240782 | |
| parent | 0986b2d0e3c5f49de2a318b7ff441be664b8d51c (diff) | |
| parent | 45dc8ebb7c860939e045cfb758968c014fdeb96d (diff) | |
| download | rust-de0feb30bd54fe26e1bb2a0a75ea519708ab8f76.tar.gz rust-de0feb30bd54fe26e1bb2a0a75ea519708ab8f76.zip | |
Rollup merge of #93910 - rosehuds:master, r=cjgillot
fix mention of moved function in `rustc_hir` docs The function was moved from `Crate` to `Map` in db9fea508a6d but these docs weren't updated
| -rw-r--r-- | compiler/rustc_hir/src/itemlikevisit.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_hir/src/itemlikevisit.rs b/compiler/rustc_hir/src/itemlikevisit.rs index 0db562f91a6..db70002c2d6 100644 --- a/compiler/rustc_hir/src/itemlikevisit.rs +++ b/compiler/rustc_hir/src/itemlikevisit.rs @@ -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 @@ -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 |
