Skip to content

Commit 616482e

Browse files
committed
Add note explaining OnlyBodies filter better
1 parent d724d96 commit 616482e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_middle/src/hir/nested_filter.rs

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ use rustc_hir::intravisit::nested_filter::NestedFilter;
33
/// Do not visit nested item-like things, but visit nested things
44
/// that are inside of an item-like.
55
///
6+
/// Notably, possible occurrences of bodies in non-item-like things
7+
/// include: closures/generators, inline `const {}` blocks, and
8+
/// constant arguments of types, e.g. in `let _: [(); /* HERE */];`.
9+
///
610
/// **This is the most common choice.** A very common pattern is
711
/// to use `visit_all_item_likes()` as an outer loop,
812
/// and to have the visitor that visits the contents of each item

0 commit comments

Comments
 (0)