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:
bors 2023-12-08 11:31:34 +00:00
commit 6bbb2ac304
4 changed files with 263 additions and 5 deletions

View file

@ -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(