Skip to content

Commit 760cf8d

Browse files
committed
Fix hir pretty-printing of global_asm!.
One of the boxes isn't closed, and this causes everything after it to be over-indented.
1 parent 3896ad0 commit 760cf8d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,10 +654,11 @@ impl<'a> State<'a> {
654654
self.bclose(item.span, cb);
655655
}
656656
hir::ItemKind::GlobalAsm { asm, .. } => {
657-
// FIXME(nnethercote): `ib` is unclosed
658-
let (cb, _ib) = self.head("global_asm!");
657+
let (cb, ib) = self.head("global_asm!");
659658
self.print_inline_asm(asm);
660-
self.end(cb)
659+
self.word(";");
660+
self.end(cb);
661+
self.end(ib);
661662
}
662663
hir::ItemKind::TyAlias(ident, ty, generics) => {
663664
let (cb, ib) = self.head("type");

tests/ui/unpretty/exhaustive-asm.hir.stdout

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ mod expressions {
2727
mod items {
2828
/// ItemKind::GlobalAsm
2929
mod item_global_asm {/// ItemKind::GlobalAsm
30-
global_asm! (".globl my_asm_func") }
30+
global_asm! (".globl my_asm_func");
3131
}
32+
}

0 commit comments

Comments
 (0)