mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Correctly support SelfType when searching for usages
This commit is contained in:
parent
96c5df9b17
commit
41f470fea8
6 changed files with 214 additions and 80 deletions
|
@ -2071,6 +2071,10 @@ impl Type {
|
|||
Some(adt.into())
|
||||
}
|
||||
|
||||
pub fn as_builtin(&self) -> Option<BuiltinType> {
|
||||
self.ty.as_builtin().map(|inner| BuiltinType { inner })
|
||||
}
|
||||
|
||||
pub fn as_dyn_trait(&self) -> Option<Trait> {
|
||||
self.ty.dyn_trait().map(Into::into)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue