mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
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)
This commit is contained in:
parent
413c87f155
commit
a1ed53a4f1
11 changed files with 333 additions and 51 deletions
|
@ -84,7 +84,8 @@ impl ImplBlock {
|
|||
}
|
||||
|
||||
pub fn target_trait_ref(&self, db: &impl HirDatabase) -> Option<TraitRef> {
|
||||
TraitRef::from_hir(db, &self.resolver(db), &self.target_trait(db)?)
|
||||
let target_ty = self.target_ty(db);
|
||||
TraitRef::from_hir(db, &self.resolver(db), &self.target_trait(db)?, Some(target_ty))
|
||||
}
|
||||
|
||||
pub fn items(&self, db: &impl DefDatabase) -> Vec<ImplItem> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue