File tree 2 files changed +8
-5
lines changed
compiler/rustc_ast_pretty/src/pprust
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> {
1285
1285
self . print_visibility ( & item. vis ) ;
1286
1286
self . print_defaultness ( defaultness) ;
1287
1287
self . print_unsafety ( unsafety) ;
1288
- self . word_nbsp ( "impl" ) ;
1289
- self . print_constness ( constness) ;
1288
+ self . word ( "impl" ) ;
1290
1289
1291
- if !generics. params . is_empty ( ) {
1290
+ if generics. params . is_empty ( ) {
1291
+ self . nbsp ( ) ;
1292
+ } else {
1292
1293
self . print_generic_params ( & generics. params ) ;
1293
1294
self . space ( ) ;
1294
1295
}
1295
1296
1297
+ self . print_constness ( constness) ;
1298
+
1296
1299
if let ast:: ImplPolarity :: Negative ( _) = polarity {
1297
1300
self . word ( "!" ) ;
1298
1301
}
Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ fn test_item() {
603
603
stringify_item!(
604
604
impl <T > Struct <T > { }
605
605
) ,
606
- "impl <T> Struct<T> {}" , // FIXME
606
+ "impl<T> Struct<T> {}" ,
607
607
) ;
608
608
assert_eq ! (
609
609
stringify_item!(
@@ -615,7 +615,7 @@ fn test_item() {
615
615
stringify_item!(
616
616
impl <T > const Trait for T { }
617
617
) ,
618
- "impl const <T> Trait for T {}" , // FIXME
618
+ "impl<T> const Trait for T {}" ,
619
619
) ;
620
620
assert_eq ! (
621
621
stringify_item!(
You can’t perform that action at this time.
0 commit comments