aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-07 02:33:22 +0100
committerJonas Schievink <[email protected]>2021-04-07 02:33:22 +0100
commit7c1c0e6feadc017f5919f789f974405635fc25e3 (patch)
treebe2ec91cdd13c8125e560bb414a37866ae573642 /crates/hir_def/src
parentf04f38d3d79c3cc51956bc530a34e32945cdb294 (diff)
Collect trait impls inside unnamed consts
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r--crates/hir_def/src/item_scope.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_scope.rs b/crates/hir_def/src/item_scope.rs
index 08feee1e7..9014468ea 100644
--- a/crates/hir_def/src/item_scope.rs
+++ b/crates/hir_def/src/item_scope.rs
@@ -107,6 +107,10 @@ impl ItemScope {
107 .map(|(_, v)| v) 107 .map(|(_, v)| v)
108 } 108 }
109 109
110 pub fn unnamed_consts(&self) -> impl Iterator<Item = ConstId> + '_ {
111 self.unnamed_consts.iter().copied()
112 }
113
110 /// Iterate over all module scoped macros 114 /// Iterate over all module scoped macros
111 pub(crate) fn macros<'a>(&'a self) -> impl Iterator<Item = (&'a Name, MacroDefId)> + 'a { 115 pub(crate) fn macros<'a>(&'a self) -> impl Iterator<Item = (&'a Name, MacroDefId)> + 'a {
112 self.entries().filter_map(|(name, def)| def.take_macros().map(|macro_| (name, macro_))) 116 self.entries().filter_map(|(name, def)| def.take_macros().map(|macro_| (name, macro_)))