diff options
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/item_scope.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_scope.rs b/crates/hir_def/src/item_scope.rs index 12c24e1ca..a8b3fe844 100644 --- a/crates/hir_def/src/item_scope.rs +++ b/crates/hir_def/src/item_scope.rs | |||
@@ -95,6 +95,12 @@ impl ItemScope { | |||
95 | self.impls.iter().copied() | 95 | self.impls.iter().copied() |
96 | } | 96 | } |
97 | 97 | ||
98 | pub fn values( | ||
99 | &self, | ||
100 | ) -> impl Iterator<Item = (ModuleDefId, Visibility)> + ExactSizeIterator + '_ { | ||
101 | self.values.values().copied() | ||
102 | } | ||
103 | |||
98 | pub fn visibility_of(&self, def: ModuleDefId) -> Option<Visibility> { | 104 | pub fn visibility_of(&self, def: ModuleDefId) -> Option<Visibility> { |
99 | self.name_of(ItemInNs::Types(def)) | 105 | self.name_of(ItemInNs::Types(def)) |
100 | .or_else(|| self.name_of(ItemInNs::Values(def))) | 106 | .or_else(|| self.name_of(ItemInNs::Values(def))) |