diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-13 16:58:04 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-13 16:58:04 +0000 |
commit | 6ab405f2e9861c34ab9e1ad86af6604523745cef (patch) | |
tree | a9c674c83723e2ed145793f72450c873da62a6fc /crates/hir/src | |
parent | d4533785698d439417bc5474fecd62a7f1707368 (diff) | |
parent | 9719ce9fc731a400c9744ba1a6569e978c1a97e7 (diff) |
Merge #7998
7998: Use more Chalk IDs r=flodiebold a=flodiebold
Co-authored-by: Florian Diebold <[email protected]>
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 }) |