diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-28 22:54:07 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-28 22:54:07 +0000 |
commit | 5df3ee8274fdb7cdeb2b0871b4efea8cbf4724a1 (patch) | |
tree | c1769a152888b97134e3f3811d4504f467ce1047 /crates/hir_ty/src/display.rs | |
parent | 72457d022d704c47ab9dbfee6a1b29063cc9cc5d (diff) | |
parent | 407196b8c0f23e3ddc26e789b84542b1fd9b0eb8 (diff) |
Merge #7816
7816: Lift Ty::Fn into a struct r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r-- | crates/hir_ty/src/display.rs | 12 |
1 files changed, 6 insertions, 6 deletions
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 @@ | |||
3 | use std::{borrow::Cow, fmt}; | 3 | use std::{borrow::Cow, fmt}; |
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | db::HirDatabase, primitive, utils::generics, CallableDefId, FnSig, GenericPredicate, Lifetime, | 6 | db::HirDatabase, primitive, utils::generics, CallableDefId, CallableSig, GenericPredicate, |
7 | Obligation, OpaqueTy, OpaqueTyId, ProjectionTy, Scalar, Substs, TraitRef, Ty, | 7 | Lifetime, Obligation, OpaqueTy, OpaqueTyId, ProjectionTy, Scalar, Substs, TraitRef, Ty, |
8 | }; | 8 | }; |
9 | use arrayvec::ArrayVec; | 9 | use arrayvec::ArrayVec; |
10 | use hir_def::{ | 10 | use hir_def::{ |
@@ -341,8 +341,8 @@ impl HirDisplay for Ty { | |||
341 | write!(f, ")")?; | 341 | write!(f, ")")?; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | Ty::FnPtr { is_varargs, substs, .. } => { | 344 | Ty::Function(fn_ptr) => { |
345 | let sig = FnSig::from_fn_ptr_substs(&substs, *is_varargs); | 345 | let sig = CallableSig::from_fn_ptr(fn_ptr); |
346 | sig.hir_fmt(f)?; | 346 | sig.hir_fmt(f)?; |
347 | } | 347 | } |
348 | Ty::FnDef(def, parameters) => { | 348 | Ty::FnDef(def, parameters) => { |
@@ -494,7 +494,7 @@ impl HirDisplay for Ty { | |||
494 | } | 494 | } |
495 | } | 495 | } |
496 | } | 496 | } |
497 | Ty::Closure { substs, .. } => { | 497 | Ty::Closure(.., substs) => { |
498 | let sig = substs[0].callable_sig(f.db); | 498 | let sig = substs[0].callable_sig(f.db); |
499 | if let Some(sig) = sig { | 499 | if let Some(sig) = sig { |
500 | if sig.params().is_empty() { | 500 | if sig.params().is_empty() { |
@@ -571,7 +571,7 @@ impl HirDisplay for Ty { | |||
571 | } | 571 | } |
572 | } | 572 | } |
573 | 573 | ||
574 | impl HirDisplay for FnSig { | 574 | impl HirDisplay for CallableSig { |
575 | fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { | 575 | fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { |
576 | write!(f, "fn(")?; | 576 | write!(f, "fn(")?; |
577 | f.write_joined(self.params(), ", ")?; | 577 | f.write_joined(self.params(), ", ")?; |