Correctly support SelfType when searching for usages

This commit is contained in:
Lukas Wirth 2021-05-08 22:34:55 +02:00
parent 96c5df9b17
commit 41f470fea8
6 changed files with 214 additions and 80 deletions

View file

@ -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)
}