diff options
Diffstat (limited to 'crates/hir_ty/src/types.rs')
-rw-r--r-- | crates/hir_ty/src/types.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_ty/src/types.rs b/crates/hir_ty/src/types.rs index dc64e6e2b..bd89991dc 100644 --- a/crates/hir_ty/src/types.rs +++ b/crates/hir_ty/src/types.rs | |||
@@ -29,6 +29,12 @@ pub struct ProjectionTy { | |||
29 | pub substitution: Substitution, | 29 | pub substitution: Substitution, |
30 | } | 30 | } |
31 | 31 | ||
32 | impl ProjectionTy { | ||
33 | pub fn self_type_parameter(&self, interner: &Interner) -> &Ty { | ||
34 | &self.substitution.interned()[0].assert_ty_ref(interner) | ||
35 | } | ||
36 | } | ||
37 | |||
32 | #[derive(Clone, PartialEq, Eq, Debug, Hash)] | 38 | #[derive(Clone, PartialEq, Eq, Debug, Hash)] |
33 | pub struct DynTy { | 39 | pub struct DynTy { |
34 | /// The unknown self type. | 40 | /// The unknown self type. |