diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 6e0d89466..43f932e20 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -1132,6 +1132,10 @@ impl Type { | |||
1132 | Some(self.ty.value.as_callable()?.0) | 1132 | Some(self.ty.value.as_callable()?.0) |
1133 | } | 1133 | } |
1134 | 1134 | ||
1135 | pub fn is_closure(&self) -> bool { | ||
1136 | matches!(&self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Closure { .. }, .. })) | ||
1137 | } | ||
1138 | |||
1135 | pub fn contains_unknown(&self) -> bool { | 1139 | pub fn contains_unknown(&self) -> bool { |
1136 | return go(&self.ty.value); | 1140 | return go(&self.ty.value); |
1137 | 1141 | ||