diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 3f645a1dd..fb788736d 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -1136,6 +1136,13 @@ impl Type { | |||
1136 | matches!(&self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Closure { .. }, .. })) | 1136 | matches!(&self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Closure { .. }, .. })) |
1137 | } | 1137 | } |
1138 | 1138 | ||
1139 | pub fn is_fn(&self) -> bool { | ||
1140 | matches!(&self.ty.value, | ||
1141 | Ty::Apply(ApplicationTy { ctor: TypeCtor::FnDef(..), .. }) | | ||
1142 | Ty::Apply(ApplicationTy { ctor: TypeCtor::FnPtr { .. }, .. }) | ||
1143 | ) | ||
1144 | } | ||
1145 | |||
1139 | pub fn contains_unknown(&self) -> bool { | 1146 | pub fn contains_unknown(&self) -> bool { |
1140 | return go(&self.ty.value); | 1147 | return go(&self.ty.value); |
1141 | 1148 | ||