aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-17 09:57:49 +0100
committerAleksey Kladov <[email protected]>2020-07-17 11:04:10 +0100
commit371c5aec1c4ad18f37e96b4bf85c49563fc4a01d (patch)
tree99f9d4757248115f7e5f30a53395f1cb99c089b3 /crates/ra_hir_ty/src
parentf88a737a439f7801b7521c66c124ea5a44736e13 (diff)
call_info works with closures
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r--crates/ra_hir_ty/src/lib.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs
index 1f6626c46..7698cb0d4 100644
--- a/crates/ra_hir_ty/src/lib.rs
+++ b/crates/ra_hir_ty/src/lib.rs
@@ -767,15 +767,6 @@ impl Ty {
767 } 767 }
768 } 768 }
769 769
770 pub fn as_callable(&self) -> Option<(CallableDefId, &Substs)> {
771 match self {
772 Ty::Apply(ApplicationTy { ctor: TypeCtor::FnDef(callable_def), parameters }) => {
773 Some((*callable_def, parameters))
774 }
775 _ => None,
776 }
777 }
778
779 pub fn is_never(&self) -> bool { 770 pub fn is_never(&self) -> bool {
780 matches!(self, Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. })) 771 matches!(self, Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. }))
781 } 772 }
@@ -807,7 +798,7 @@ impl Ty {
807 } 798 }
808 } 799 }
809 800
810 pub(crate) fn callable_sig(&self, db: &dyn HirDatabase) -> Option<FnSig> { 801 pub fn callable_sig(&self, db: &dyn HirDatabase) -> Option<FnSig> {
811 match self { 802 match self {
812 Ty::Apply(a_ty) => match a_ty.ctor { 803 Ty::Apply(a_ty) => match a_ty.ctor {
813 TypeCtor::FnPtr { is_varargs, .. } => { 804 TypeCtor::FnPtr { is_varargs, .. } => {