aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/tls.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk/tls.rs b/crates/ra_hir_ty/src/traits/chalk/tls.rs
index 0a8932dae..fa8e4d1ad 100644
--- a/crates/ra_hir_ty/src/traits/chalk/tls.rs
+++ b/crates/ra_hir_ty/src/traits/chalk/tls.rs
@@ -2,6 +2,7 @@
2use std::fmt; 2use std::fmt;
3 3
4use chalk_ir::{AliasTy, Goal, Goals, Lifetime, Parameter, ProgramClauseImplication, TypeName}; 4use chalk_ir::{AliasTy, Goal, Goals, Lifetime, Parameter, ProgramClauseImplication, TypeName};
5use itertools::Itertools;
5 6
6use super::{from_chalk, Interner}; 7use super::{from_chalk, Interner};
7use crate::{db::HirDatabase, CallableDef, TypeCtor}; 8use crate::{db::HirDatabase, CallableDef, TypeCtor};
@@ -133,14 +134,15 @@ impl DebugContext<'_> {
133 }; 134 };
134 let trait_data = self.0.trait_data(trait_); 135 let trait_data = self.0.trait_data(trait_);
135 let params = alias.substitution.parameters(&Interner); 136 let params = alias.substitution.parameters(&Interner);
136 write!( 137 write!(fmt, "<{:?} as {}", &params[0], trait_data.name,)?;
137 fmt, 138 if params.len() > 1 {
138 "<{:?} as {}<{:?}>>::{}", 139 write!(
139 &params[0], 140 fmt,
140 trait_data.name, 141 "<{}>",
141 &params[1..], 142 &params[1..].iter().format_with(", ", |x, f| f(&format_args!("{:?}", x))),
142 type_alias_data.name 143 )?;
143 ) 144 }
145 write!(fmt, ">::{}", type_alias_data.name)
144 } 146 }
145 147
146 pub fn debug_ty( 148 pub fn debug_ty(