mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
MIR episode 5
This commit is contained in:
parent
9b3387454d
commit
cbcafd3539
36 changed files with 1532 additions and 362 deletions
|
@ -699,7 +699,7 @@ pub fn lookup_impl_method(
|
|||
};
|
||||
|
||||
let name = &db.function_data(func).name;
|
||||
lookup_impl_assoc_item_for_trait_ref(trait_ref, db, env, name)
|
||||
let Some((impl_fn, impl_subst)) = lookup_impl_assoc_item_for_trait_ref(trait_ref, db, env, name)
|
||||
.and_then(|assoc| {
|
||||
if let (AssocItemId::FunctionId(id), subst) = assoc {
|
||||
Some((id, subst))
|
||||
|
@ -707,7 +707,16 @@ pub fn lookup_impl_method(
|
|||
None
|
||||
}
|
||||
})
|
||||
.unwrap_or((func, fn_subst))
|
||||
else {
|
||||
return (func, fn_subst);
|
||||
};
|
||||
(
|
||||
impl_fn,
|
||||
Substitution::from_iter(
|
||||
Interner,
|
||||
fn_subst.iter(Interner).take(fn_params).chain(impl_subst.iter(Interner)),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
fn lookup_impl_assoc_item_for_trait_ref(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue