diff options
author | Florian Diebold <[email protected]> | 2019-01-04 18:29:53 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-01-04 18:29:53 +0000 |
commit | 443ddb73c395a311b4ddff3bd8267a0eb7079216 (patch) | |
tree | 416d588a0bda45399c54297482189c58ce4681ce /crates/ra_hir/src/ids.rs | |
parent | 334ca0d9a790d14414301daa896848bf9a880982 (diff) |
Do impl collection per module, not per crate
Diffstat (limited to 'crates/ra_hir/src/ids.rs')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index c98be66f9..4d6378e02 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -185,8 +185,9 @@ impl DefId { | |||
185 | 185 | ||
186 | /// Returns the containing impl block, if this is an impl item. | 186 | /// Returns the containing impl block, if this is an impl item. |
187 | pub fn impl_block(self, db: &impl HirDatabase) -> Cancelable<Option<ImplBlock>> { | 187 | pub fn impl_block(self, db: &impl HirDatabase) -> Cancelable<Option<ImplBlock>> { |
188 | let crate_impls = db.impls_in_crate(ctry!(self.krate(db)?))?; | 188 | let loc = self.loc(db); |
189 | Ok(ImplBlock::containing(crate_impls, self)) | 189 | let module_impls = db.impls_in_module(loc.source_root_id, loc.module_id)?; |
190 | Ok(ImplBlock::containing(module_impls, self)) | ||
190 | } | 191 | } |
191 | } | 192 | } |
192 | 193 | ||