Fix spacing of pretty printed const item without body
This commit is contained in:
@@ -1116,9 +1116,9 @@ impl<'a> State<'a> {
|
|||||||
self.print_ident(ident);
|
self.print_ident(ident);
|
||||||
self.word_space(":");
|
self.word_space(":");
|
||||||
self.print_type(ty);
|
self.print_type(ty);
|
||||||
self.space();
|
|
||||||
self.end(); // end the head-ibox
|
self.end(); // end the head-ibox
|
||||||
if let Some(body) = body {
|
if let Some(body) = body {
|
||||||
|
self.space();
|
||||||
self.word_space("=");
|
self.word_space("=");
|
||||||
self.print_expr(body);
|
self.print_expr(body);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ struct C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow()]
|
#[allow()]
|
||||||
const C: C =
|
const C: C
|
||||||
|
=
|
||||||
C{
|
C{
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
field: 0,
|
field: 0,
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ fn test_item() {
|
|||||||
stringify_item!(
|
stringify_item!(
|
||||||
static S: ();
|
static S: ();
|
||||||
),
|
),
|
||||||
"static S: () ;", // FIXME
|
"static S: ();",
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
stringify_item!(
|
stringify_item!(
|
||||||
@@ -402,7 +402,7 @@ fn test_item() {
|
|||||||
stringify_item!(
|
stringify_item!(
|
||||||
const S: ();
|
const S: ();
|
||||||
),
|
),
|
||||||
"const S: () ;", // FIXME
|
"const S: ();",
|
||||||
);
|
);
|
||||||
|
|
||||||
// ItemKind::Fn
|
// ItemKind::Fn
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ fn main() {
|
|||||||
crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
|
crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
|
||||||
crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
|
crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
|
||||||
}
|
}
|
||||||
const _: () =
|
const _: ()
|
||||||
|
=
|
||||||
{
|
{
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
#[rustc_proc_macro_decls]
|
#[rustc_proc_macro_decls]
|
||||||
|
|||||||
Reference in New Issue
Block a user