mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Replace remaining uses of Substitution::build_for_def
This commit is contained in:
parent
77333a571f
commit
5d2b488aeb
6 changed files with 46 additions and 21 deletions
|
@ -709,7 +709,7 @@ pub(crate) fn inherent_impl_substs(
|
|||
) -> Option<Substitution> {
|
||||
// we create a var for each type parameter of the impl; we need to keep in
|
||||
// mind here that `self_ty` might have vars of its own
|
||||
let vars = Substitution::build_for_def(db, impl_id)
|
||||
let vars = TyBuilder::subst_for_def(db, impl_id)
|
||||
.fill_with_bound_vars(DebruijnIndex::INNERMOST, self_ty.binders.len(&Interner))
|
||||
.build();
|
||||
let self_ty_with_vars = db.impl_self_ty(impl_id).subst(&vars);
|
||||
|
@ -760,13 +760,13 @@ fn transform_receiver_ty(
|
|||
self_ty: &Canonical<Ty>,
|
||||
) -> Option<Ty> {
|
||||
let substs = match function_id.lookup(db.upcast()).container {
|
||||
AssocContainerId::TraitId(_) => Substitution::build_for_def(db, function_id)
|
||||
AssocContainerId::TraitId(_) => TyBuilder::subst_for_def(db, function_id)
|
||||
.push(self_ty.value.clone())
|
||||
.fill_with_unknown()
|
||||
.build(),
|
||||
AssocContainerId::ImplId(impl_id) => {
|
||||
let impl_substs = inherent_impl_substs(db, impl_id, &self_ty)?;
|
||||
Substitution::build_for_def(db, function_id)
|
||||
TyBuilder::subst_for_def(db, function_id)
|
||||
.use_parent_substs(&impl_substs)
|
||||
.fill_with_unknown()
|
||||
.build()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue