diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs index bd87987010e8f..54bac29a6cee0 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs @@ -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 { diff --git a/src/test/ui/asm/unpretty-expanded.rs b/src/test/ui/asm/unpretty-expanded.rs new file mode 100644 index 0000000000000..6128f49b89a34 --- /dev/null +++ b/src/test/ui/asm/unpretty-expanded.rs @@ -0,0 +1,3 @@ +// check-pass +// compile-flags: -Zunpretty=expanded +core::arch::global_asm!("x: .byte 42"); diff --git a/src/test/ui/asm/unpretty-expanded.stdout b/src/test/ui/asm/unpretty-expanded.stdout new file mode 100644 index 0000000000000..15b60d1559c65 --- /dev/null +++ b/src/test/ui/asm/unpretty-expanded.stdout @@ -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");