File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
compiler/rustc_ast_pretty/src/pprust Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1285,14 +1285,17 @@ impl<'a> State<'a> {
12851285 self.print_visibility(&item.vis);
12861286 self.print_defaultness(defaultness);
12871287 self.print_unsafety(unsafety);
1288- self.word_nbsp("impl");
1289- self.print_constness(constness);
1288+ self.word("impl");
12901289
1291- if !generics.params.is_empty() {
1290+ if generics.params.is_empty() {
1291+ self.nbsp();
1292+ } else {
12921293 self.print_generic_params(&generics.params);
12931294 self.space();
12941295 }
12951296
1297+ self.print_constness(constness);
1298+
12961299 if let ast::ImplPolarity::Negative(_) = polarity {
12971300 self.word("!");
12981301 }
Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ fn test_item() {
603603 stringify_item!(
604604 impl<T> Struct<T> {}
605605 ),
606- "impl <T> Struct<T> {}", // FIXME
606+ "impl<T> Struct<T> {}",
607607 );
608608 assert_eq!(
609609 stringify_item!(
@@ -615,7 +615,7 @@ fn test_item() {
615615 stringify_item!(
616616 impl<T> const Trait for T {}
617617 ),
618- "impl const <T> Trait for T {}", // FIXME
618+ "impl<T> const Trait for T {}",
619619 );
620620 assert_eq!(
621621 stringify_item!(
You can’t perform that action at this time.
0 commit comments