diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/ty/method_resolution.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index 88d012a74..3f4c43aee 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs | |||
@@ -68,6 +68,15 @@ impl CrateImplBlocks { | |||
68 | ) | 68 | ) |
69 | } | 69 | } |
70 | 70 | ||
71 | pub fn all_impls<'a>(&'a self) -> impl Iterator<Item = ImplBlock> + 'a { | ||
72 | self.impls.values().chain(self.impls_by_trait.values()).flat_map(|i| i.iter()).map( | ||
73 | move |(module_id, impl_id)| { | ||
74 | let module = Module { krate: self.krate, module_id: *module_id }; | ||
75 | ImplBlock::from_id(module, *impl_id) | ||
76 | }, | ||
77 | ) | ||
78 | } | ||
79 | |||
71 | fn collect_recursive(&mut self, db: &impl HirDatabase, module: Module) { | 80 | fn collect_recursive(&mut self, db: &impl HirDatabase, module: Module) { |
72 | let module_impl_blocks = db.impls_in_module(module); | 81 | let module_impl_blocks = db.impls_in_module(module); |
73 | 82 | ||