Add a HirDisplay implementation for TraitRef
This commit is contained in:
@@ -534,3 +534,20 @@ impl HirDisplay for Ty {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl HirDisplay for TraitRef {
|
||||||
|
fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result {
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
"{}: {}",
|
||||||
|
self.substs[0].display(f.db),
|
||||||
|
self.trait_.name(f.db).unwrap_or_else(Name::missing)
|
||||||
|
)?;
|
||||||
|
if self.substs.len() > 1 {
|
||||||
|
write!(f, "<")?;
|
||||||
|
f.write_joined(&self.substs[1..], ", ")?;
|
||||||
|
write!(f, ">")?;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user