diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-08 23:09:03 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-08 23:09:03 +0100 |
commit | cf4d4f646b6227242b2d4e216e8e30b5e111e02e (patch) | |
tree | eb8a2ca7b63125f6975067b2ee1439244b3cbf97 /crates/hir | |
parent | 6cd11bbbc235bcc3891f20c6d4097834cf1990e5 (diff) | |
parent | 3a346412cf8ce2f04e123195452bf1b1c86211a7 (diff) |
Merge #8773
8773: fix: Correctly support SelfType when searching for usages r=Veykril a=Veykril
Fixes #7443
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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 { | |||
2071 | Some(adt.into()) | 2071 | Some(adt.into()) |
2072 | } | 2072 | } |
2073 | 2073 | ||
2074 | pub fn as_builtin(&self) -> Option<BuiltinType> { | ||
2075 | self.ty.as_builtin().map(|inner| BuiltinType { inner }) | ||
2076 | } | ||
2077 | |||
2074 | pub fn as_dyn_trait(&self) -> Option<Trait> { | 2078 | pub fn as_dyn_trait(&self) -> Option<Trait> { |
2075 | self.ty.dyn_trait().map(Into::into) | 2079 | self.ty.dyn_trait().map(Into::into) |
2076 | } | 2080 | } |