aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index b7f50b714..776613c7c 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -800,6 +800,10 @@ impl HirDisplay for &Ty {
800 800
801impl HirDisplay for ApplicationTy { 801impl HirDisplay for ApplicationTy {
802 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { 802 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result {
803 if f.should_truncate() {
804 return write!(f, "…");
805 }
806
803 match self.ctor { 807 match self.ctor {
804 TypeCtor::Bool => write!(f, "bool")?, 808 TypeCtor::Bool => write!(f, "bool")?,
805 TypeCtor::Char => write!(f, "char")?, 809 TypeCtor::Char => write!(f, "char")?,
@@ -901,6 +905,10 @@ impl HirDisplay for ApplicationTy {
901 905
902impl HirDisplay for ProjectionTy { 906impl HirDisplay for ProjectionTy {
903 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { 907 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result {
908 if f.should_truncate() {
909 return write!(f, "…");
910 }
911
904 let trait_name = self 912 let trait_name = self
905 .associated_ty 913 .associated_ty
906 .parent_trait(f.db) 914 .parent_trait(f.db)
@@ -919,6 +927,10 @@ impl HirDisplay for ProjectionTy {
919 927
920impl HirDisplay for Ty { 928impl HirDisplay for Ty {
921 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { 929 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result {
930 if f.should_truncate() {
931 return write!(f, "…");
932 }
933
922 match self { 934 match self {
923 Ty::Apply(a_ty) => a_ty.hir_fmt(f)?, 935 Ty::Apply(a_ty) => a_ty.hir_fmt(f)?,
924 Ty::Projection(p_ty) => p_ty.hir_fmt(f)?, 936 Ty::Projection(p_ty) => p_ty.hir_fmt(f)?,
@@ -1001,6 +1013,10 @@ impl HirDisplay for Ty {
1001 1013
1002impl TraitRef { 1014impl TraitRef {
1003 fn hir_fmt_ext(&self, f: &mut HirFormatter<impl HirDatabase>, use_as: bool) -> fmt::Result { 1015 fn hir_fmt_ext(&self, f: &mut HirFormatter<impl HirDatabase>, use_as: bool) -> fmt::Result {
1016 if f.should_truncate() {
1017 return write!(f, "…");
1018 }
1019
1004 self.substs[0].hir_fmt(f)?; 1020 self.substs[0].hir_fmt(f)?;
1005 if use_as { 1021 if use_as {
1006 write!(f, " as ")?; 1022 write!(f, " as ")?;
@@ -1031,6 +1047,10 @@ impl HirDisplay for &GenericPredicate {
1031 1047
1032impl HirDisplay for GenericPredicate { 1048impl HirDisplay for GenericPredicate {
1033 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { 1049 fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result {
1050 if f.should_truncate() {
1051 return write!(f, "…");
1052 }
1053
1034 match self { 1054 match self {
1035 GenericPredicate::Implemented(trait_ref) => trait_ref.hir_fmt(f)?, 1055 GenericPredicate::Implemented(trait_ref) => trait_ref.hir_fmt(f)?,
1036 GenericPredicate::Projection(projection_pred) => { 1056 GenericPredicate::Projection(projection_pred) => {