@@ -110,6 +110,7 @@ impl<'a> State<'a> {
110110 }
111111 self . print_attr_item ( & unparsed, unparsed. span ) ;
112112 self . word ( "]" ) ;
113+ self . hardbreak ( )
113114 }
114115 hir:: Attribute :: Parsed ( AttributeKind :: DocComment { style, kind, comment, .. } ) => {
115116 self . word ( rustc_ast_pretty:: pprust:: state:: doc_comment_to_string (
@@ -183,7 +184,7 @@ impl<'a> State<'a> {
183184 Node :: Ty ( a) => self . print_type ( a) ,
184185 Node :: AssocItemConstraint ( a) => self . print_assoc_item_constraint ( a) ,
185186 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" ) ,
187188 Node :: Pat ( a) => self . print_pat ( a) ,
188189 Node :: TyPat ( a) => self . print_ty_pat ( a) ,
189190 Node :: PatField ( a) => self . print_patfield ( a) ,
@@ -654,10 +655,11 @@ impl<'a> State<'a> {
654655 self . bclose ( item. span , cb) ;
655656 }
656657 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!" ) ;
659659 self . print_inline_asm ( asm) ;
660- self . end ( cb)
660+ self . word ( ";" ) ;
661+ self . end ( cb) ;
662+ self . end ( ib) ;
661663 }
662664 hir:: ItemKind :: TyAlias ( ident, ty, generics) => {
663665 let ( cb, ib) = self . head ( "type" ) ;
@@ -764,14 +766,6 @@ impl<'a> State<'a> {
764766 self . print_path ( t. path , false ) ;
765767 }
766768
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-
775769 fn print_formal_generic_params ( & mut self , generic_params : & [ hir:: GenericParam < ' _ > ] ) {
776770 if !generic_params. is_empty ( ) {
777771 self . word ( "for" ) ;
@@ -1509,7 +1503,7 @@ impl<'a> State<'a> {
15091503 }
15101504 hir:: ExprKind :: DropTemps ( init) => {
15111505 // Print `{`:
1512- let cb = self . cbox ( INDENT_UNIT ) ;
1506+ let cb = self . cbox ( 0 ) ;
15131507 let ib = self . ibox ( 0 ) ;
15141508 self . bopen ( ib) ;
15151509
@@ -1532,16 +1526,18 @@ impl<'a> State<'a> {
15321526 self . print_if ( test, blk, elseopt) ;
15331527 }
15341528 hir:: ExprKind :: Loop ( blk, opt_label, _, _) => {
1529+ let cb = self . cbox ( 0 ) ;
1530+ let ib = self . ibox ( 0 ) ;
15351531 if let Some ( label) = opt_label {
15361532 self . print_ident ( label. ident ) ;
15371533 self . word_space ( ":" ) ;
15381534 }
1539- let ( cb , ib ) = self . head ( "loop" ) ;
1535+ self . word_nbsp ( "loop" ) ;
15401536 self . print_block ( blk, cb, ib) ;
15411537 }
15421538 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 ) ;
15451541 self . word_nbsp ( "match" ) ;
15461542 self . print_expr_as_cond ( expr) ;
15471543 self . space ( ) ;
@@ -1572,15 +1568,6 @@ impl<'a> State<'a> {
15721568
15731569 // This is a bare expression.
15741570 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 ) ;
15841571 }
15851572 hir:: ExprKind :: Block ( blk, opt_label) => {
15861573 if let Some ( label) = opt_label {
0 commit comments