diff options
-rw-r--r-- | crates/ra_hir/src/ty.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 24c45d728..12429a668 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -534,3 +534,20 @@ impl HirDisplay for Ty { | |||
534 | Ok(()) | 534 | Ok(()) |
535 | } | 535 | } |
536 | } | 536 | } |
537 | |||
538 | impl HirDisplay for TraitRef { | ||
539 | fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { | ||
540 | write!( | ||
541 | f, | ||
542 | "{}: {}", | ||
543 | self.substs[0].display(f.db), | ||
544 | self.trait_.name(f.db).unwrap_or_else(Name::missing) | ||
545 | )?; | ||
546 | if self.substs.len() > 1 { | ||
547 | write!(f, "<")?; | ||
548 | f.write_joined(&self.substs[1..], ", ")?; | ||
549 | write!(f, ">")?; | ||
550 | } | ||
551 | Ok(()) | ||
552 | } | ||
553 | } | ||