Fix hir pretty-printing of global_asm!.

One of the boxes isn't closed, and this causes everything after it to be
over-indented.
This commit is contained in:
Nicholas Nethercote
2025-04-29 20:07:10 +10:00
parent 3896ad0acd
commit 760cf8d3af
2 changed files with 6 additions and 4 deletions

View File

@@ -654,10 +654,11 @@ impl<'a> State<'a> {
self.bclose(item.span, cb);
}
hir::ItemKind::GlobalAsm { asm, .. } => {
// FIXME(nnethercote): `ib` is unclosed
let (cb, _ib) = self.head("global_asm!");
let (cb, ib) = self.head("global_asm!");
self.print_inline_asm(asm);
self.end(cb)
self.word(";");
self.end(cb);
self.end(ib);
}
hir::ItemKind::TyAlias(ident, ty, generics) => {
let (cb, ib) = self.head("type");

View File

@@ -27,5 +27,6 @@ mod expressions {
mod items {
/// ItemKind::GlobalAsm
mod item_global_asm {/// ItemKind::GlobalAsm
global_asm! (".globl my_asm_func") }
global_asm! (".globl my_asm_func");
}
}