diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-16 15:24:51 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-08-16 15:24:51 +0100 |
commit | cd2434999768d3767814bc8b437bd5fb91263ef6 (patch) | |
tree | fd75a42035182e3fd4aade2c9df5d610ea2dbacd /crates/ra_hir/src | |
parent | af1052bb4c8e5dc3584670e2859324776c228b6a (diff) | |
parent | 35a04ec066b1a4ece2a6aa5e74dd8beae52e68f1 (diff) |
Merge #1691
1691: Show inherent and trait impls of structs and enums r=viorina a=viorina
Co-authored-by: Ekaterina Babshukova <[email protected]>
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 | ||