@@ -110,6 +110,7 @@ impl<'a> State<'a> {
110
110
}
111
111
self . print_attr_item ( & unparsed, unparsed. span ) ;
112
112
self . word ( "]" ) ;
113
+ self . hardbreak ( )
113
114
}
114
115
hir:: Attribute :: Parsed ( AttributeKind :: DocComment { style, kind, comment, .. } ) => {
115
116
self . word ( rustc_ast_pretty:: pprust:: state:: doc_comment_to_string (
@@ -183,7 +184,7 @@ impl<'a> State<'a> {
183
184
Node :: Ty ( a) => self . print_type ( a) ,
184
185
Node :: AssocItemConstraint ( a) => self . print_assoc_item_constraint ( a) ,
185
186
Node :: TraitRef ( a) => self . print_trait_ref ( a) ,
186
- Node :: OpaqueTy ( o ) => self . print_opaque_ty ( o ) ,
187
+ Node :: OpaqueTy ( _ ) => panic ! ( "cannot print Node::OpaqueTy" ) ,
187
188
Node :: Pat ( a) => self . print_pat ( a) ,
188
189
Node :: TyPat ( a) => self . print_ty_pat ( a) ,
189
190
Node :: PatField ( a) => self . print_patfield ( a) ,
@@ -654,10 +655,11 @@ impl<'a> State<'a> {
654
655
self . bclose ( item. span , cb) ;
655
656
}
656
657
hir:: ItemKind :: GlobalAsm { asm, .. } => {
657
- // FIXME(nnethercote): `ib` is unclosed
658
- let ( cb, _ib) = self . head ( "global_asm!" ) ;
658
+ let ( cb, ib) = self . head ( "global_asm!" ) ;
659
659
self . print_inline_asm ( asm) ;
660
- self . end ( cb)
660
+ self . word ( ";" ) ;
661
+ self . end ( cb) ;
662
+ self . end ( ib) ;
661
663
}
662
664
hir:: ItemKind :: TyAlias ( ident, ty, generics) => {
663
665
let ( cb, ib) = self . head ( "type" ) ;
@@ -764,14 +766,6 @@ impl<'a> State<'a> {
764
766
self . print_path ( t. path , false ) ;
765
767
}
766
768
767
- fn print_opaque_ty ( & mut self , o : & hir:: OpaqueTy < ' _ > ) {
768
- // FIXME(nnethercote): `cb` and `ib` are unclosed
769
- let ( _cb, _ib) = self . head ( "opaque" ) ;
770
- self . word ( "{" ) ;
771
- self . print_bounds ( "impl" , o. bounds ) ;
772
- self . word ( "}" ) ;
773
- }
774
-
775
769
fn print_formal_generic_params ( & mut self , generic_params : & [ hir:: GenericParam < ' _ > ] ) {
776
770
if !generic_params. is_empty ( ) {
777
771
self . word ( "for" ) ;
@@ -1509,7 +1503,7 @@ impl<'a> State<'a> {
1509
1503
}
1510
1504
hir:: ExprKind :: DropTemps ( init) => {
1511
1505
// Print `{`:
1512
- let cb = self . cbox ( INDENT_UNIT ) ;
1506
+ let cb = self . cbox ( 0 ) ;
1513
1507
let ib = self . ibox ( 0 ) ;
1514
1508
self . bopen ( ib) ;
1515
1509
@@ -1532,16 +1526,18 @@ impl<'a> State<'a> {
1532
1526
self . print_if ( test, blk, elseopt) ;
1533
1527
}
1534
1528
hir:: ExprKind :: Loop ( blk, opt_label, _, _) => {
1529
+ let cb = self . cbox ( 0 ) ;
1530
+ let ib = self . ibox ( 0 ) ;
1535
1531
if let Some ( label) = opt_label {
1536
1532
self . print_ident ( label. ident ) ;
1537
1533
self . word_space ( ":" ) ;
1538
1534
}
1539
- let ( cb , ib ) = self . head ( "loop" ) ;
1535
+ self . word_nbsp ( "loop" ) ;
1540
1536
self . print_block ( blk, cb, ib) ;
1541
1537
}
1542
1538
hir:: ExprKind :: Match ( expr, arms, _) => {
1543
- let cb = self . cbox ( INDENT_UNIT ) ;
1544
- let ib = self . ibox ( INDENT_UNIT ) ;
1539
+ let cb = self . cbox ( 0 ) ;
1540
+ let ib = self . ibox ( 0 ) ;
1545
1541
self . word_nbsp ( "match" ) ;
1546
1542
self . print_expr_as_cond ( expr) ;
1547
1543
self . space ( ) ;
@@ -1572,15 +1568,6 @@ impl<'a> State<'a> {
1572
1568
1573
1569
// This is a bare expression.
1574
1570
self . ann . nested ( self , Nested :: Body ( body) ) ;
1575
- // FIXME(nnethercote): this is bogus
1576
- let fake_ib = BoxMarker ;
1577
- self . end ( fake_ib) ;
1578
-
1579
- // A box will be closed by `print_expr`, but we didn't want an overall
1580
- // wrapper so we closed the corresponding opening. so create an
1581
- // empty box to satisfy the close.
1582
- // FIXME(nnethercote): this is bogus, and `print_expr` is missing
1583
- let _ib = self . ibox ( 0 ) ;
1584
1571
}
1585
1572
hir:: ExprKind :: Block ( blk, opt_label) => {
1586
1573
if let Some ( label) = opt_label {
0 commit comments