1
Fork 0

Fix spacing and ordering of words in pretty printed Impl

This commit is contained in:
David Tolnay 2021-12-29 12:10:24 -08:00
parent f3df63f8ee
commit a24e238bdf
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
2 changed files with 8 additions and 5 deletions

View file

@ -1285,14 +1285,17 @@ impl<'a> State<'a> {
self.print_visibility(&item.vis);
self.print_defaultness(defaultness);
self.print_unsafety(unsafety);
self.word_nbsp("impl");
self.print_constness(constness);
self.word("impl");
if !generics.params.is_empty() {
if generics.params.is_empty() {
self.nbsp();
} else {
self.print_generic_params(&generics.params);
self.space();
}
self.print_constness(constness);
if let ast::ImplPolarity::Negative(_) = polarity {
self.word("!");
}