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_ty/src/display.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/hir_ty/src/display.rs') diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 4a25a49e3..179f7ff44 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -3,8 +3,8 @@ use std::{borrow::Cow, fmt}; use crate::{ - db::HirDatabase, primitive, utils::generics, CallableDefId, FnSig, GenericPredicate, Lifetime, - Obligation, OpaqueTy, OpaqueTyId, ProjectionTy, Scalar, Substs, TraitRef, Ty, + db::HirDatabase, primitive, utils::generics, CallableDefId, CallableSig, GenericPredicate, + Lifetime, Obligation, OpaqueTy, OpaqueTyId, ProjectionTy, Scalar, Substs, TraitRef, Ty, }; use arrayvec::ArrayVec; use hir_def::{ @@ -341,8 +341,8 @@ impl HirDisplay for Ty { write!(f, ")")?; } } - Ty::FnPtr { is_varargs, substs, .. } => { - let sig = FnSig::from_fn_ptr_substs(&substs, *is_varargs); + Ty::Function(fn_ptr) => { + let sig = CallableSig::from_fn_ptr(fn_ptr); sig.hir_fmt(f)?; } Ty::FnDef(def, parameters) => { @@ -494,7 +494,7 @@ impl HirDisplay for Ty { } } } - Ty::Closure { substs, .. } => { + Ty::Closure(.., substs) => { let sig = substs[0].callable_sig(f.db); if let Some(sig) = sig { if sig.params().is_empty() { @@ -571,7 +571,7 @@ impl HirDisplay for Ty { } } -impl HirDisplay for FnSig { +impl HirDisplay for CallableSig { fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { write!(f, "fn(")?; f.write_joined(self.params(), ", ")?; -- cgit v1.2.3