1
Fork 0

Support pretty-printing dyn* trait objects

This commit is contained in:
David Tolnay 2024-12-20 20:33:59 -08:00
parent 13170cd787
commit 1cc8289791
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
4 changed files with 11 additions and 10 deletions

View file

@ -402,8 +402,10 @@ impl<'a> State<'a> {
}
hir::TyKind::Path(ref qpath) => self.print_qpath(qpath, false),
hir::TyKind::TraitObject(bounds, lifetime, syntax) => {
if syntax == ast::TraitObjectSyntax::Dyn {
self.word_space("dyn");
match syntax {
ast::TraitObjectSyntax::Dyn => self.word_nbsp("dyn"),
ast::TraitObjectSyntax::DynStar => self.word_nbsp("dyn*"),
ast::TraitObjectSyntax::None => {}
}
let mut first = true;
for bound in bounds {