diff options
Diffstat (limited to 'crates/hir/src')
-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 7b9de11ed..7f8f936d3 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -51,7 +51,7 @@ use hir_expand::{diagnostics::DiagnosticSink, name::name, MacroDefKind}; | |||
51 | use hir_ty::{ | 51 | use hir_ty::{ |
52 | autoderef, | 52 | autoderef, |
53 | display::{write_bounds_like_dyn_trait_with_prefix, HirDisplayError, HirFormatter}, | 53 | display::{write_bounds_like_dyn_trait_with_prefix, HirDisplayError, HirFormatter}, |
54 | method_resolution, | 54 | method_resolution, to_assoc_type_id, |
55 | traits::{FnTrait, Solution, SolutionVariables}, | 55 | traits::{FnTrait, Solution, SolutionVariables}, |
56 | AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate, | 56 | AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate, |
57 | InEnvironment, Interner, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, | 57 | InEnvironment, Interner, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, |
@@ -1683,7 +1683,10 @@ impl Type { | |||
1683 | .fill(args.iter().map(|t| t.ty.value.clone())) | 1683 | .fill(args.iter().map(|t| t.ty.value.clone())) |
1684 | .build(); | 1684 | .build(); |
1685 | let predicate = ProjectionPredicate { | 1685 | let predicate = ProjectionPredicate { |
1686 | projection_ty: ProjectionTy { associated_ty: alias.id, parameters: subst }, | 1686 | projection_ty: ProjectionTy { |
1687 | associated_ty: to_assoc_type_id(alias.id), | ||
1688 | parameters: subst, | ||
1689 | }, | ||
1687 | ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)).intern(&Interner), | 1690 | ty: TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)).intern(&Interner), |
1688 | }; | 1691 | }; |
1689 | let goal = Canonical { | 1692 | let goal = Canonical { |
@@ -1712,10 +1715,7 @@ impl Type { | |||
1712 | } | 1715 | } |
1713 | 1716 | ||
1714 | pub fn as_callable(&self, db: &dyn HirDatabase) -> Option<Callable> { | 1717 | pub fn as_callable(&self, db: &dyn HirDatabase) -> Option<Callable> { |
1715 | let def = match self.ty.value.interned(&Interner) { | 1718 | let def = self.ty.value.callable_def(db); |
1716 | &TyKind::FnDef(def, _) => Some(def), | ||
1717 | _ => None, | ||
1718 | }; | ||
1719 | 1719 | ||
1720 | let sig = self.ty.value.callable_sig(db)?; | 1720 | let sig = self.ty.value.callable_sig(db)?; |
1721 | Some(Callable { ty: self.clone(), sig, def, is_bound_method: false }) | 1721 | Some(Callable { ty: self.clone(), sig, def, is_bound_method: false }) |