From ebdfc932e74ff11c8c14c513614212b7c07bf400 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 4 Apr 2021 13:16:16 +0200 Subject: Replace Substitution::type_params --- crates/hir/src/display.rs | 4 ++-- crates/hir/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/hir/src') diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index 559ea31a0..993772aac 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs @@ -13,7 +13,7 @@ use syntax::ast::{self, NameOwner}; use crate::{ Adt, Const, ConstParam, Enum, Field, Function, GenericParam, HasVisibility, LifetimeParam, - Module, Static, Struct, Substitution, Trait, Type, TypeAlias, TypeParam, Union, Variant, + Module, Static, Struct, Trait, TyBuilder, Type, TypeAlias, TypeParam, Union, Variant, }; impl HirDisplay for Function { @@ -234,7 +234,7 @@ impl HirDisplay for TypeParam { fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { write!(f, "{}", self.name(f.db))?; let bounds = f.db.generic_predicates_for_param(self.id); - let substs = Substitution::type_params(f.db, self.id.parent); + let substs = TyBuilder::type_params_subst(f.db, self.id.parent); let predicates = bounds.iter().cloned().map(|b| b.subst(&substs)).collect::>(); if !(predicates.is_empty() || f.omit_verbose_types()) { write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 42ae53c66..19901ed33 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -514,7 +514,7 @@ impl Field { VariantDef::Union(it) => it.id.into(), VariantDef::Variant(it) => it.parent.id.into(), }; - let substs = Substitution::type_params(db, generic_def_id); + let substs = TyBuilder::type_params_subst(db, generic_def_id); let ty = db.field_types(var_id)[self.id].clone().subst(&substs); Type::new(db, self.parent.module(db).id.krate(), var_id, ty) } @@ -1501,7 +1501,7 @@ impl TypeParam { let resolver = self.id.parent.resolver(db.upcast()); let krate = self.id.parent.module(db.upcast()).krate(); let ty = params.get(local_idx)?.clone(); - let subst = Substitution::type_params(db, self.id.parent); + let subst = TyBuilder::type_params_subst(db, self.id.parent); let ty = ty.subst(&subst.prefix(local_idx)); Some(Type::new_with_resolver_inner(db, krate, &resolver, ty)) } -- cgit v1.2.3