@@ -606,14 +606,14 @@ impl<'hir> Map<'hir> {
606606 }
607607
608608 /// Visits all items in the crate in some deterministic (but
609- /// unspecified) order. If you just need to process every item,
610- /// but don't care about nesting, this method is the best choice.
609+ /// unspecified) order. If you need to process every item,
610+ /// and care about nesting -- usually because your algorithm
611+ /// follows lexical scoping rules -- then this method is the best choice.
612+ /// If you don't care about nesting, you should use the `tcx.hir_crate_items()` query
613+ /// or `items()` instead.
611614 ///
612- /// If you do care about nesting -- usually because your algorithm
613- /// follows lexical scoping rules -- then you want a different
614- /// approach. You should override `visit_nested_item` in your
615- /// visitor and then call `intravisit::walk_crate` instead.
616- pub fn visit_all_item_likes < V > ( self , visitor : & mut V )
615+ /// Please see the notes in `intravisit.rs` for more information.
616+ pub fn deep_visit_all_item_likes < V > ( self , visitor : & mut V )
617617 where
618618 V : Visitor < ' hir > ,
619619 {
@@ -646,7 +646,10 @@ impl<'hir> Map<'hir> {
646646 } )
647647 }
648648
649- pub fn visit_item_likes_in_module < V > ( self , module : LocalDefId , visitor : & mut V )
649+ /// If you don't care about nesting, you should use the
650+ /// `tcx.hir_module_items()` query or `module_items()` instead.
651+ /// Please see notes in `deep_visit_all_item_likes`.
652+ pub fn deep_visit_item_likes_in_module < V > ( self , module : LocalDefId , visitor : & mut V )
650653 where
651654 V : Visitor < ' hir > ,
652655 {
0 commit comments