diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-21 12:50:12 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-21 12:50:12 +0000 |
commit | 1f61915bde4c5d8d4fe2e9b8dfa9445008730b79 (patch) | |
tree | a6fd0b6ad8b6c87d28e6e1b36bb9b2fbae2c1b09 /crates/ra_hir/src/impl_block.rs | |
parent | 612a72fc4ea4376920f2a7da7b3c334227c1716c (diff) | |
parent | c37d1c5b381365ce2d07dfe4b871e43995ccea2d (diff) |
Merge #2337
2337: Move resolver to hir_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 964a3da8c..774fa1d96 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -1,11 +1,10 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use hir_def::{type_ref::TypeRef, AstItemDef}; | 3 | use hir_def::{resolver::HasResolver, type_ref::TypeRef, AstItemDef}; |
4 | use ra_syntax::ast::{self}; | 4 | use ra_syntax::ast; |
5 | 5 | ||
6 | use crate::{ | 6 | use crate::{ |
7 | db::{AstDatabase, DefDatabase, HirDatabase}, | 7 | db::{AstDatabase, DefDatabase, HirDatabase}, |
8 | resolve::HasResolver, | ||
9 | ty::Ty, | 8 | ty::Ty, |
10 | AssocItem, Crate, HasSource, ImplBlock, Module, Source, TraitRef, | 9 | AssocItem, Crate, HasSource, ImplBlock, Module, Source, TraitRef, |
11 | }; | 10 | }; |
@@ -27,12 +26,12 @@ impl ImplBlock { | |||
27 | } | 26 | } |
28 | 27 | ||
29 | pub fn target_ty(&self, db: &impl HirDatabase) -> Ty { | 28 | pub fn target_ty(&self, db: &impl HirDatabase) -> Ty { |
30 | Ty::from_hir(db, &self.resolver(db), &self.target_type(db)) | 29 | Ty::from_hir(db, &self.id.resolver(db), &self.target_type(db)) |
31 | } | 30 | } |
32 | 31 | ||
33 | pub fn target_trait_ref(&self, db: &impl HirDatabase) -> Option<TraitRef> { | 32 | pub fn target_trait_ref(&self, db: &impl HirDatabase) -> Option<TraitRef> { |
34 | let target_ty = self.target_ty(db); | 33 | let target_ty = self.target_ty(db); |
35 | TraitRef::from_hir(db, &self.resolver(db), &self.target_trait(db)?, Some(target_ty)) | 34 | TraitRef::from_hir(db, &self.id.resolver(db), &self.target_trait(db)?, Some(target_ty)) |
36 | } | 35 | } |
37 | 36 | ||
38 | pub fn items(&self, db: &impl DefDatabase) -> Vec<AssocItem> { | 37 | pub fn items(&self, db: &impl DefDatabase) -> Vec<AssocItem> { |