From 41f470fea84998af65292f3c297c3e2b1d897848 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 8 May 2021 22:34:55 +0200 Subject: Correctly support SelfType when searching for usages --- crates/hir/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/hir') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index ac23e385e..c9ef4b420 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -2071,6 +2071,10 @@ impl Type { Some(adt.into()) } + pub fn as_builtin(&self) -> Option { + self.ty.as_builtin().map(|inner| BuiltinType { inner }) + } + pub fn as_dyn_trait(&self) -> Option { self.ty.dyn_trait().map(Into::into) } -- cgit v1.2.3