mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Use correct, full substs for self type in impl
Without arbitrary self types, the self type could never refer to the method type parameters, so this wasn't a problem; but with arbitrary self types, it can. This fixes the crash from #6668; but it doesn't make method resolution work for these methods.
This commit is contained in:
parent
6943b53023
commit
e5fd550dfd
2 changed files with 26 additions and 1 deletions
|
@ -720,7 +720,13 @@ fn transform_receiver_ty(
|
|||
.push(self_ty.value.clone())
|
||||
.fill_with_unknown()
|
||||
.build(),
|
||||
AssocContainerId::ImplId(impl_id) => inherent_impl_substs(db, impl_id, &self_ty)?,
|
||||
AssocContainerId::ImplId(impl_id) => {
|
||||
let impl_substs = inherent_impl_substs(db, impl_id, &self_ty)?;
|
||||
Substs::build_for_def(db, function_id)
|
||||
.use_parent_substs(&impl_substs)
|
||||
.fill_with_unknown()
|
||||
.build()
|
||||
}
|
||||
AssocContainerId::ContainerId(_) => unreachable!(),
|
||||
};
|
||||
let sig = db.callable_item_signature(function_id.into());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue