Skip to content

Commit

Permalink
Fix global_asm macro pretty printing
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Sep 3, 2022
1 parent 0209485 commit e9b01c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_ast_pretty/src/pprust/state/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ impl<'a> State<'a> {
ast::ItemKind::GlobalAsm(ref asm) => {
self.head(visibility_qualified(&item.vis, "global_asm!"));
self.print_inline_asm(asm);
self.word(";");
self.end();
self.end();
}
ast::ItemKind::TyAlias(box ast::TyAlias {
Expand Down
3 changes: 3 additions & 0 deletions src/test/ui/asm/unpretty-expanded.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// check-pass
// compile-flags: -Zunpretty=expanded
core::arch::global_asm!("x: .byte 42");
9 changes: 9 additions & 0 deletions src/test/ui/asm/unpretty-expanded.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
// check-pass
// compile-flags: -Zunpretty=expanded
global_asm! ("x: .byte 42");

0 comments on commit e9b01c7

Please sign in to comment.