diff options
author | Florian Diebold <[email protected]> | 2019-03-31 19:02:16 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-04-14 10:28:53 +0100 |
commit | a1ed53a4f183b5826162eb9e998207b92be9c57f (patch) | |
tree | 7c139a7dc38483188653c6d40583cddac9d23192 /crates/ra_hir/src/impl_block.rs | |
parent | 413c87f155ab6b389b1cc122b5739716acccb476 (diff) |
More trait infrastructure
- make it possible to get parent trait from method
- add 'obligation' machinery for checking that a type implements a
trait (and inferring facts about type variables from that)
- handle type parameters of traits (to a certain degree)
- improve the hacky implements check to cover enough cases to exercise the
handling of traits with type parameters
- basic canonicalization (will probably also be done by Chalk)
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 822a1a0db..42c02c9fb 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -84,7 +84,8 @@ impl ImplBlock { | |||
84 | } | 84 | } |
85 | 85 | ||
86 | pub fn target_trait_ref(&self, db: &impl HirDatabase) -> Option<TraitRef> { | 86 | pub fn target_trait_ref(&self, db: &impl HirDatabase) -> Option<TraitRef> { |
87 | TraitRef::from_hir(db, &self.resolver(db), &self.target_trait(db)?) | 87 | let target_ty = self.target_ty(db); |
88 | TraitRef::from_hir(db, &self.resolver(db), &self.target_trait(db)?, Some(target_ty)) | ||
88 | } | 89 | } |
89 | 90 | ||
90 | pub fn items(&self, db: &impl DefDatabase) -> Vec<ImplItem> { | 91 | pub fn items(&self, db: &impl DefDatabase) -> Vec<ImplItem> { |