mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Auto merge of #15705 - rmehri01:14485_fix_delegate_self_references, r=Veykril
fix: resolve Self type references in delegate method assist This PR makes the delegate method assist resolve any `Self` type references in the parameters or return type. It also works across macros such as the `uint_impl!` macro used for `saturating_mul` in the issue example. Closes #14485
This commit is contained in:
commit
6bbb2ac304
4 changed files with 263 additions and 5 deletions
|
@ -588,6 +588,14 @@ impl Resolver {
|
|||
_ => None,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn impl_def(&self) -> Option<ImplId> {
|
||||
self.scopes().find_map(|scope| match scope {
|
||||
Scope::ImplDefScope(def) => Some(*def),
|
||||
_ => None,
|
||||
})
|
||||
}
|
||||
|
||||
/// `expr_id` is required to be an expression id that comes after the top level expression scope in the given resolver
|
||||
#[must_use]
|
||||
pub fn update_to_inner_scope(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue