Skip to content

Commit

Permalink
Rollup merge of rust-lang#101369 - compiler-errors:global-asm-pprint,…
Browse files Browse the repository at this point in the history
… r=jackh726

Fix `global_asm` macro pretty printing

Fixes rust-lang#101051
Fixes rust-lang#101047
  • Loading branch information
matthiaskrgr committed Sep 3, 2022
2 parents 037c979 + e9b01c7 commit a3dda51
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 a3dda51

Please sign in to comment.