From 371c5aec1c4ad18f37e96b4bf85c49563fc4a01d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 17 Jul 2020 10:57:49 +0200 Subject: call_info works with closures --- crates/ra_hir_ty/src/lib.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'crates/ra_hir_ty/src') 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 { } } - pub fn as_callable(&self) -> Option<(CallableDefId, &Substs)> { - match self { - Ty::Apply(ApplicationTy { ctor: TypeCtor::FnDef(callable_def), parameters }) => { - Some((*callable_def, parameters)) - } - _ => None, - } - } - pub fn is_never(&self) -> bool { matches!(self, Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. })) } @@ -807,7 +798,7 @@ impl Ty { } } - pub(crate) fn callable_sig(&self, db: &dyn HirDatabase) -> Option { + pub fn callable_sig(&self, db: &dyn HirDatabase) -> Option { match self { Ty::Apply(a_ty) => match a_ty.ctor { TypeCtor::FnPtr { is_varargs, .. } => { -- cgit v1.2.3