diff options
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 99d858eb3..97f162315 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -1574,9 +1574,9 @@ impl Impl { | |||
1574 | }; | 1574 | }; |
1575 | 1575 | ||
1576 | let filter = |impl_def: &Impl| { | 1576 | let filter = |impl_def: &Impl| { |
1577 | let target_ty = impl_def.target_ty(db); | 1577 | let self_ty = impl_def.self_ty(db); |
1578 | let rref = target_ty.remove_ref(); | 1578 | let rref = self_ty.remove_ref(); |
1579 | ty.equals_ctor(rref.as_ref().map_or(&target_ty.ty, |it| &it.ty)) | 1579 | ty.equals_ctor(rref.as_ref().map_or(&self_ty.ty, |it| &it.ty)) |
1580 | }; | 1580 | }; |
1581 | 1581 | ||
1582 | let mut all = Vec::new(); | 1582 | let mut all = Vec::new(); |
@@ -1614,16 +1614,16 @@ impl Impl { | |||
1614 | 1614 | ||
1615 | // FIXME: the return type is wrong. This should be a hir version of | 1615 | // FIXME: the return type is wrong. This should be a hir version of |
1616 | // `TraitRef` (ie, resolved `TypeRef`). | 1616 | // `TraitRef` (ie, resolved `TypeRef`). |
1617 | pub fn target_trait(self, db: &dyn HirDatabase) -> Option<TraitRef> { | 1617 | pub fn trait_(self, db: &dyn HirDatabase) -> Option<TraitRef> { |
1618 | db.impl_data(self.id).target_trait.clone() | 1618 | db.impl_data(self.id).target_trait.clone() |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | pub fn target_ty(self, db: &dyn HirDatabase) -> Type { | 1621 | pub fn self_ty(self, db: &dyn HirDatabase) -> Type { |
1622 | let impl_data = db.impl_data(self.id); | 1622 | let impl_data = db.impl_data(self.id); |
1623 | let resolver = self.id.resolver(db.upcast()); | 1623 | let resolver = self.id.resolver(db.upcast()); |
1624 | let krate = self.id.lookup(db.upcast()).container.krate(); | 1624 | let krate = self.id.lookup(db.upcast()).container.krate(); |
1625 | let ctx = hir_ty::TyLoweringContext::new(db, &resolver); | 1625 | let ctx = hir_ty::TyLoweringContext::new(db, &resolver); |
1626 | let ty = ctx.lower_ty(&impl_data.target_type); | 1626 | let ty = ctx.lower_ty(&impl_data.self_ty); |
1627 | Type::new_with_resolver_inner(db, krate, &resolver, ty) | 1627 | Type::new_with_resolver_inner(db, krate, &resolver, ty) |
1628 | } | 1628 | } |
1629 | 1629 | ||