]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_ast_pretty/src/pprust/state/item.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / compiler / rustc_ast_pretty / src / pprust / state / item.rs
index f1caf22f3640fc9ced4e03f4df36e955e1ff58de..54bac29a6cee0fd7fe05a7445367f920e910c42d 100644 (file)
@@ -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 {
@@ -412,9 +414,9 @@ impl<'a> State<'a> {
     pub(crate) fn print_visibility(&mut self, vis: &ast::Visibility) {
         match vis.kind {
             ast::VisibilityKind::Public => self.word_nbsp("pub"),
-            ast::VisibilityKind::Restricted { ref path, .. } => {
+            ast::VisibilityKind::Restricted { ref path, id: _, shorthand } => {
                 let path = Self::to_string(|s| s.print_path(path, false, 0));
-                if path == "crate" || path == "self" || path == "super" {
+                if shorthand && (path == "crate" || path == "self" || path == "super") {
                     self.word_nbsp(format!("pub({})", path))
                 } else {
                     self.word_nbsp(format!("pub(in {})", path))