File tree 1 file changed +6
-0
lines changed
compiler/rustc_middle/src/hir
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ pub struct ModuleItems {
30
30
}
31
31
32
32
impl ModuleItems {
33
+ /// Returns all non-associated locally defined items in all modules.
34
+ ///
35
+ /// Note that this does *not* include associated items of `impl` blocks! It also does not
36
+ /// include foreign items. If you want to e.g. get all functions, use `definitions()` below.
33
37
pub fn items ( & self ) -> impl Iterator < Item = ItemId > + ' _ {
34
38
self . items . iter ( ) . copied ( )
35
39
}
@@ -38,6 +42,8 @@ impl ModuleItems {
38
42
self . trait_items . iter ( ) . copied ( )
39
43
}
40
44
45
+ /// Returns all items that are associated with some `impl` block (both inherent and trait impl
46
+ /// blocks).
41
47
pub fn impl_items ( & self ) -> impl Iterator < Item = ImplItemId > + ' _ {
42
48
self . impl_items . iter ( ) . copied ( )
43
49
}
You can’t perform that action at this time.
0 commit comments