mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix: prefer keeping Self if it is in the same impl def
This commit is contained in:
parent
f4349ff26e
commit
7e768cbe70
4 changed files with 28 additions and 11 deletions
|
@ -1556,6 +1556,10 @@ impl SemanticsScope<'_> {
|
|||
pub fn extern_crate_decls(&self) -> impl Iterator<Item = Name> + '_ {
|
||||
self.resolver.extern_crate_decls_in_scope(self.db.upcast())
|
||||
}
|
||||
|
||||
pub fn has_same_self_type(&self, other: &SemanticsScope<'_>) -> bool {
|
||||
self.resolver.impl_def() == other.resolver.impl_def()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue