File tree 3 files changed +7
-7
lines changed
rustc_ast_pretty/src/pprust
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1354,9 +1354,7 @@ impl<'a> State<'a> {
1354
1354
self . bclose ( item. span , empty) ;
1355
1355
}
1356
1356
ast:: ItemKind :: TraitAlias ( ref generics, ref bounds) => {
1357
- self . head ( "" ) ;
1358
- self . print_visibility ( & item. vis ) ;
1359
- self . word_nbsp ( "trait" ) ;
1357
+ self . head ( visibility_qualified ( & item. vis , "trait" ) ) ;
1360
1358
self . print_ident ( item. ident ) ;
1361
1359
self . print_generic_params ( & generics. params ) ;
1362
1360
let mut real_bounds = Vec :: with_capacity ( bounds. len ( ) ) ;
@@ -1374,6 +1372,8 @@ impl<'a> State<'a> {
1374
1372
self . print_type_bounds ( "=" , & real_bounds) ;
1375
1373
self . print_where_clause ( & generics. where_clause ) ;
1376
1374
self . word ( ";" ) ;
1375
+ self . end ( ) ; // end inner head-block
1376
+ self . end ( ) ; // end outer head-block
1377
1377
}
1378
1378
ast:: ItemKind :: MacCall ( ref mac) => {
1379
1379
self . print_mac ( mac) ;
Original file line number Diff line number Diff line change @@ -705,9 +705,7 @@ impl<'a> State<'a> {
705
705
self . bclose ( item. span ) ;
706
706
}
707
707
hir:: ItemKind :: TraitAlias ( ref generics, ref bounds) => {
708
- self . head ( "" ) ;
709
- self . print_visibility ( & item. vis ) ;
710
- self . word_nbsp ( "trait" ) ;
708
+ self . head ( visibility_qualified ( & item. vis , "trait" ) ) ;
711
709
self . print_ident ( item. ident ) ;
712
710
self . print_generic_params ( & generics. params ) ;
713
711
let mut real_bounds = Vec :: with_capacity ( bounds. len ( ) ) ;
@@ -725,6 +723,8 @@ impl<'a> State<'a> {
725
723
self . print_bounds ( "=" , real_bounds) ;
726
724
self . print_where_clause ( & generics. where_clause ) ;
727
725
self . word ( ";" ) ;
726
+ self . end ( ) ; // end inner head-block
727
+ self . end ( ) ; // end outer head-block
728
728
}
729
729
}
730
730
self . ann . post ( self , AnnNode :: Item ( item) )
Original file line number Diff line number Diff line change @@ -589,7 +589,7 @@ fn test_item() {
589
589
stringify_item!(
590
590
pub trait Trait <T > = Sized where T : ' a;
591
591
) ,
592
- "" , // FIXME
592
+ "pub trait Trait<T> = Sized where T: 'a;" ,
593
593
) ;
594
594
595
595
// ItemKind::Impl
You can’t perform that action at this time.
0 commit comments