diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index f0c1d017326..6c4f38e9f63 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -1116,9 +1116,9 @@ fn print_item_const( self.print_ident(ident); self.word_space(":"); self.print_type(ty); - self.space(); self.end(); // end the head-ibox if let Some(body) = body { + self.space(); self.word_space("="); self.print_expr(body); } diff --git a/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs b/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs index ed7879001d5..5dd04a569e7 100644 --- a/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs +++ b/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs @@ -7,7 +7,8 @@ struct C { } #[allow()] -const C: C = +const C: C + = C{ #[cfg(debug_assertions)] field: 0, diff --git a/src/test/pretty/nested-item-vis-defaultness.rs b/src/test/pretty/nested-item-vis-defaultness.rs index f46c0e3f1bc..b094ba577db 100644 --- a/src/test/pretty/nested-item-vis-defaultness.rs +++ b/src/test/pretty/nested-item-vis-defaultness.rs @@ -6,42 +6,42 @@ fn main() {} #[cfg(FALSE)] extern "C" { - static X: u8 ; + static X: u8; type X; fn foo(); - pub static X: u8 ; + pub static X: u8; pub type X; pub fn foo(); } #[cfg(FALSE)] trait T { - const X: u8 ; + const X: u8; type X; fn foo(); - default const X: u8 ; + default const X: u8; default type X; default fn foo(); - pub const X: u8 ; + pub const X: u8; pub type X; pub fn foo(); - pub default const X: u8 ; + pub default const X: u8; pub default type X; pub default fn foo(); } #[cfg(FALSE)] impl T for S { - const X: u8 ; + const X: u8; type X; fn foo(); - default const X: u8 ; + default const X: u8; default type X; default fn foo(); - pub const X: u8 ; + pub const X: u8; pub type X; pub fn foo(); - pub default const X: u8 ; + pub default const X: u8; pub default type X; pub default fn foo(); } diff --git a/src/test/ui/macros/stringify.rs b/src/test/ui/macros/stringify.rs index 90bc7dc1da2..7d1c05a85bc 100644 --- a/src/test/ui/macros/stringify.rs +++ b/src/test/ui/macros/stringify.rs @@ -382,13 +382,13 @@ fn test_item() { stringify_item!( static S: (); ), - "static S: () ;", // FIXME + "static S: ();", ); assert_eq!( stringify_item!( static mut S: (); ), - "static mut S: () ;", + "static mut S: ();", ); // ItemKind::Const @@ -402,7 +402,7 @@ fn test_item() { stringify_item!( const S: (); ), - "const S: () ;", // FIXME + "const S: ();", ); // ItemKind::Fn diff --git a/src/test/ui/proc-macro/quote-debug.stdout b/src/test/ui/proc-macro/quote-debug.stdout index 4bdc04b9ac4..d806d7c9aad 100644 --- a/src/test/ui/proc-macro/quote-debug.stdout +++ b/src/test/ui/proc-macro/quote-debug.stdout @@ -43,7 +43,8 @@ fn main() { crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}', crate::Spacing::Alone)))].iter().cloned().collect::() } -const _: () = +const _: () + = { extern crate proc_macro; #[rustc_proc_macro_decls]