From 407196b8c0f23e3ddc26e789b84542b1fd9b0eb8 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 28 Feb 2021 22:12:07 +0100 Subject: Lift FnPointer into a struct --- crates/hir/src/code_model.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir/src/code_model.rs') diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 1c31e29ac..5a1691eff 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -31,9 +31,9 @@ use hir_ty::{ display::{write_bounds_like_dyn_trait_with_prefix, HirDisplayError, HirFormatter}, method_resolution, traits::{FnTrait, Solution, SolutionVariables}, - BoundVar, CallableDefId, Canonical, DebruijnIndex, FnSig, GenericPredicate, InEnvironment, - Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, TraitEnvironment, Ty, TyDefId, - TyKind, + BoundVar, CallableDefId, CallableSig, Canonical, DebruijnIndex, GenericPredicate, + InEnvironment, Obligation, ProjectionPredicate, ProjectionTy, Scalar, Substs, TraitEnvironment, + Ty, TyDefId, TyKind, }; use rustc_hash::FxHashSet; use stdx::{format_to, impl_from}; @@ -1692,7 +1692,7 @@ impl Type { } pub fn is_fn(&self) -> bool { - matches!(&self.ty.value, Ty::FnDef(..) | Ty::FnPtr { .. }) + matches!(&self.ty.value, Ty::FnDef(..) | Ty::Function { .. }) } pub fn is_packed(&self, db: &dyn HirDatabase) -> bool { @@ -1974,7 +1974,7 @@ impl HirDisplay for Type { #[derive(Debug)] pub struct Callable { ty: Type, - sig: FnSig, + sig: CallableSig, def: Option, pub(crate) is_bound_method: bool, } -- cgit v1.2.3