File tree Expand file tree Collapse file tree 3 files changed +16
-14
lines changed
compiler/rustc_ast_pretty/src/pprust Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -1116,7 +1116,9 @@ impl<'a> State<'a> {
11161116 self . print_ident ( ident) ;
11171117 self . word_space ( ":" ) ;
11181118 self . print_type ( ty) ;
1119- self . space ( ) ;
1119+ if body. is_some ( ) {
1120+ self . space ( ) ;
1121+ }
11201122 self . end ( ) ; // end the head-ibox
11211123 if let Some ( body) = body {
11221124 self . word_space ( "=" ) ;
Original file line number Diff line number Diff line change @@ -6,42 +6,42 @@ fn main() {}
66
77#[ cfg( FALSE ) ]
88extern "C" {
9- static X : u8 ;
9+ static X : u8 ;
1010 type X ;
1111 fn foo ( ) ;
12- pub static X : u8 ;
12+ pub static X : u8 ;
1313 pub type X ;
1414 pub fn foo ( ) ;
1515}
1616
1717#[ cfg( FALSE ) ]
1818trait T {
19- const X : u8 ;
19+ const X : u8 ;
2020 type X ;
2121 fn foo ( ) ;
22- default const X : u8 ;
22+ default const X : u8 ;
2323 default type X ;
2424 default fn foo ( ) ;
25- pub const X : u8 ;
25+ pub const X : u8 ;
2626 pub type X ;
2727 pub fn foo ( ) ;
28- pub default const X : u8 ;
28+ pub default const X : u8 ;
2929 pub default type X ;
3030 pub default fn foo ( ) ;
3131}
3232
3333#[ cfg( FALSE ) ]
3434impl T for S {
35- const X : u8 ;
35+ const X : u8 ;
3636 type X ;
3737 fn foo ( ) ;
38- default const X : u8 ;
38+ default const X : u8 ;
3939 default type X ;
4040 default fn foo ( ) ;
41- pub const X : u8 ;
41+ pub const X : u8 ;
4242 pub type X ;
4343 pub fn foo ( ) ;
44- pub default const X : u8 ;
44+ pub default const X : u8 ;
4545 pub default type X ;
4646 pub default fn foo ( ) ;
4747}
Original file line number Diff line number Diff line change @@ -382,13 +382,13 @@ fn test_item() {
382382 stringify_item!(
383383 static S : ( ) ;
384384 ) ,
385- "static S: () ;" , // FIXME
385+ "static S: ();" ,
386386 ) ;
387387 assert_eq ! (
388388 stringify_item!(
389389 static mut S : ( ) ;
390390 ) ,
391- "static mut S: () ;" ,
391+ "static mut S: ();" ,
392392 ) ;
393393
394394 // ItemKind::Const
@@ -402,7 +402,7 @@ fn test_item() {
402402 stringify_item!(
403403 const S : ( ) ;
404404 ) ,
405- "const S: () ;" , // FIXME
405+ "const S: ();" ,
406406 ) ;
407407
408408 // ItemKind::Fn
You can’t perform that action at this time.
0 commit comments