diff options
author | Lukas Wirth <[email protected]> | 2021-02-28 18:46:59 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-02-28 19:15:56 +0000 |
commit | faf2dd49e4845e1437b704a28bb5603be5fd605b (patch) | |
tree | f3183d296fada9a5847687f5bbdf0c336ed65504 /crates/hir_ty/src/lib.rs | |
parent | a3f5491a1a312393429a44028e7496fe0a12f8c2 (diff) |
Fix code_model::Type::walk not walking all types
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 5cbb9a3cc..117d69f01 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -726,11 +726,11 @@ impl Ty { | |||
726 | 726 | ||
727 | pub fn callable_sig(&self, db: &dyn HirDatabase) -> Option<FnSig> { | 727 | pub fn callable_sig(&self, db: &dyn HirDatabase) -> Option<FnSig> { |
728 | match self { | 728 | match self { |
729 | &Ty::FnPtr { is_varargs, substs: ref parameters, .. } => { | 729 | Ty::FnPtr { is_varargs, substs: parameters, .. } => { |
730 | Some(FnSig::from_fn_ptr_substs(¶meters, is_varargs)) | 730 | Some(FnSig::from_fn_ptr_substs(¶meters, *is_varargs)) |
731 | } | 731 | } |
732 | &Ty::FnDef(def, ref parameters) => { | 732 | Ty::FnDef(def, parameters) => { |
733 | let sig = db.callable_item_signature(def); | 733 | let sig = db.callable_item_signature(*def); |
734 | Some(sig.subst(¶meters)) | 734 | Some(sig.subst(¶meters)) |
735 | } | 735 | } |
736 | Ty::Closure { substs: parameters, .. } => { | 736 | Ty::Closure { substs: parameters, .. } => { |
@@ -783,7 +783,6 @@ impl Ty { | |||
783 | | Ty::AssociatedType(_, substs) | 783 | | Ty::AssociatedType(_, substs) |
784 | | Ty::ForeignType(_, substs) | 784 | | Ty::ForeignType(_, substs) |
785 | | Ty::Closure { substs, .. } => Some(substs), | 785 | | Ty::Closure { substs, .. } => Some(substs), |
786 | |||
787 | _ => None, | 786 | _ => None, |
788 | } | 787 | } |
789 | } | 788 | } |
@@ -802,7 +801,6 @@ impl Ty { | |||
802 | | Ty::AssociatedType(_, substs) | 801 | | Ty::AssociatedType(_, substs) |
803 | | Ty::ForeignType(_, substs) | 802 | | Ty::ForeignType(_, substs) |
804 | | Ty::Closure { substs, .. } => Some(substs), | 803 | | Ty::Closure { substs, .. } => Some(substs), |
805 | |||
806 | _ => None, | 804 | _ => None, |
807 | } | 805 | } |
808 | } | 806 | } |