File tree 3 files changed +16
-14
lines changed
compiler/rustc_ast_pretty/src/pprust
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> {
1116
1116
self . print_ident ( ident) ;
1117
1117
self . word_space ( ":" ) ;
1118
1118
self . print_type ( ty) ;
1119
- self . space ( ) ;
1119
+ if body. is_some ( ) {
1120
+ self . space ( ) ;
1121
+ }
1120
1122
self . end ( ) ; // end the head-ibox
1121
1123
if let Some ( body) = body {
1122
1124
self . word_space ( "=" ) ;
Original file line number Diff line number Diff line change @@ -6,42 +6,42 @@ fn main() {}
6
6
7
7
#[ cfg( FALSE ) ]
8
8
extern "C" {
9
- static X : u8 ;
9
+ static X : u8 ;
10
10
type X ;
11
11
fn foo ( ) ;
12
- pub static X : u8 ;
12
+ pub static X : u8 ;
13
13
pub type X ;
14
14
pub fn foo ( ) ;
15
15
}
16
16
17
17
#[ cfg( FALSE ) ]
18
18
trait T {
19
- const X : u8 ;
19
+ const X : u8 ;
20
20
type X ;
21
21
fn foo ( ) ;
22
- default const X : u8 ;
22
+ default const X : u8 ;
23
23
default type X ;
24
24
default fn foo ( ) ;
25
- pub const X : u8 ;
25
+ pub const X : u8 ;
26
26
pub type X ;
27
27
pub fn foo ( ) ;
28
- pub default const X : u8 ;
28
+ pub default const X : u8 ;
29
29
pub default type X ;
30
30
pub default fn foo ( ) ;
31
31
}
32
32
33
33
#[ cfg( FALSE ) ]
34
34
impl T for S {
35
- const X : u8 ;
35
+ const X : u8 ;
36
36
type X ;
37
37
fn foo ( ) ;
38
- default const X : u8 ;
38
+ default const X : u8 ;
39
39
default type X ;
40
40
default fn foo ( ) ;
41
- pub const X : u8 ;
41
+ pub const X : u8 ;
42
42
pub type X ;
43
43
pub fn foo ( ) ;
44
- pub default const X : u8 ;
44
+ pub default const X : u8 ;
45
45
pub default type X ;
46
46
pub default fn foo ( ) ;
47
47
}
Original file line number Diff line number Diff line change @@ -382,13 +382,13 @@ fn test_item() {
382
382
stringify_item!(
383
383
static S : ( ) ;
384
384
) ,
385
- "static S: () ;" , // FIXME
385
+ "static S: ();" ,
386
386
) ;
387
387
assert_eq ! (
388
388
stringify_item!(
389
389
static mut S : ( ) ;
390
390
) ,
391
- "static mut S: () ;" ,
391
+ "static mut S: ();" ,
392
392
) ;
393
393
394
394
// ItemKind::Const
@@ -402,7 +402,7 @@ fn test_item() {
402
402
stringify_item!(
403
403
const S : ( ) ;
404
404
) ,
405
- "const S: () ;" , // FIXME
405
+ "const S: ();" ,
406
406
) ;
407
407
408
408
// ItemKind::Fn
You can’t perform that action at this time.
0 commit comments