aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index ad79a79f8..12dd5fb38 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -57,8 +57,8 @@ use hir_ty::{
57 to_assoc_type_id, 57 to_assoc_type_id,
58 traits::{FnTrait, Solution, SolutionVariables}, 58 traits::{FnTrait, Solution, SolutionVariables},
59 AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate, 59 AliasTy, BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate,
60 InEnvironment, Interner, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, Ty, 60 InEnvironment, Interner, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substitution,
61 TyDefId, TyKind, TyVariableKind, 61 Ty, TyDefId, TyKind, TyVariableKind,
62}; 62};
63use itertools::Itertools; 63use itertools::Itertools;
64use rustc_hash::FxHashSet; 64use rustc_hash::FxHashSet;
@@ -518,7 +518,7 @@ impl Field {
518 VariantDef::Union(it) => it.id.into(), 518 VariantDef::Union(it) => it.id.into(),
519 VariantDef::Variant(it) => it.parent.id.into(), 519 VariantDef::Variant(it) => it.parent.id.into(),
520 }; 520 };
521 let substs = Substs::type_params(db, generic_def_id); 521 let substs = Substitution::type_params(db, generic_def_id);
522 let ty = db.field_types(var_id)[self.id].clone().subst(&substs); 522 let ty = db.field_types(var_id)[self.id].clone().subst(&substs);
523 Type::new(db, self.parent.module(db).id.krate(), var_id, ty) 523 Type::new(db, self.parent.module(db).id.krate(), var_id, ty)
524 } 524 }
@@ -1471,7 +1471,7 @@ impl TypeParam {
1471 let resolver = self.id.parent.resolver(db.upcast()); 1471 let resolver = self.id.parent.resolver(db.upcast());
1472 let krate = self.id.parent.module(db.upcast()).krate(); 1472 let krate = self.id.parent.module(db.upcast()).krate();
1473 let ty = params.get(local_idx)?.clone(); 1473 let ty = params.get(local_idx)?.clone();
1474 let subst = Substs::type_params(db, self.id.parent); 1474 let subst = Substitution::type_params(db, self.id.parent);
1475 let ty = ty.subst(&subst.prefix(local_idx)); 1475 let ty = ty.subst(&subst.prefix(local_idx));
1476 Some(Type::new_with_resolver_inner(db, krate, &resolver, ty)) 1476 Some(Type::new_with_resolver_inner(db, krate, &resolver, ty))
1477 } 1477 }
@@ -1674,7 +1674,7 @@ impl Type {
1674 krate: CrateId, 1674 krate: CrateId,
1675 def: impl HasResolver + Into<TyDefId> + Into<GenericDefId>, 1675 def: impl HasResolver + Into<TyDefId> + Into<GenericDefId>,
1676 ) -> Type { 1676 ) -> Type {
1677 let substs = Substs::build_for_def(db, def).fill_with_unknown().build(); 1677 let substs = Substitution::build_for_def(db, def).fill_with_unknown().build();
1678 let ty = db.ty(def.into()).subst(&substs); 1678 let ty = db.ty(def.into()).subst(&substs);
1679 Type::new(db, krate, def, ty) 1679 Type::new(db, krate, def, ty)
1680 } 1680 }
@@ -1754,7 +1754,7 @@ impl Type {
1754 pub fn impls_trait(&self, db: &dyn HirDatabase, trait_: Trait, args: &[Type]) -> bool { 1754 pub fn impls_trait(&self, db: &dyn HirDatabase, trait_: Trait, args: &[Type]) -> bool {
1755 let trait_ref = hir_ty::TraitRef { 1755 let trait_ref = hir_ty::TraitRef {
1756 trait_: trait_.id, 1756 trait_: trait_.id,
1757 substs: Substs::build_for_def(db, trait_.id) 1757 substs: Substitution::build_for_def(db, trait_.id)
1758 .push(self.ty.value.clone()) 1758 .push(self.ty.value.clone())
1759 .fill(args.iter().map(|t| t.ty.value.clone())) 1759 .fill(args.iter().map(|t| t.ty.value.clone()))
1760 .build(), 1760 .build(),
@@ -1778,7 +1778,7 @@ impl Type {
1778 args: &[Type], 1778 args: &[Type],
1779 alias: TypeAlias, 1779 alias: TypeAlias,
1780 ) -> Option<Type> { 1780 ) -> Option<Type> {
1781 let subst = Substs::build_for_def(db, trait_.id) 1781 let subst = Substitution::build_for_def(db, trait_.id)
1782 .push(self.ty.value.clone()) 1782 .push(self.ty.value.clone())
1783 .fill(args.iter().map(|t| t.ty.value.clone())) 1783 .fill(args.iter().map(|t| t.ty.value.clone()))
1784 .build(); 1784 .build();
@@ -2045,7 +2045,7 @@ impl Type {
2045 fn walk_substs( 2045 fn walk_substs(
2046 db: &dyn HirDatabase, 2046 db: &dyn HirDatabase,
2047 type_: &Type, 2047 type_: &Type,
2048 substs: &Substs, 2048 substs: &Substitution,
2049 cb: &mut impl FnMut(Type), 2049 cb: &mut impl FnMut(Type),
2050 ) { 2050 ) {
2051 for ty in substs.iter() { 2051 for ty in substs.iter() {