Skip to content

Commit bc164ce

Browse files
Aaron1011indirect
authored andcommitted
Don't print additional spaces when pretty-printing NoDelim groups
1 parent 455461e commit bc164ce

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/librustc_ast_pretty/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ fn token_kind_to_string_ext(tok: &TokenKind, convert_dollar_crate: Option<Span>)
257257
token::CloseDelim(token::Bracket) => "]".to_string(),
258258
token::OpenDelim(token::Brace) => "{".to_string(),
259259
token::CloseDelim(token::Brace) => "}".to_string(),
260-
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) => " ".to_string(),
260+
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) => "".to_string(),
261261
token::Pound => "#".to_string(),
262262
token::Dollar => "$".to_string(),
263263
token::Question => "?".to_string(),

src/test/ui/proc-macro/input-interpolated.stdout

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
PRINT-BANG INPUT (DISPLAY): A
2-
PRINT-BANG RE-COLLECTED (DISPLAY): A
32
PRINT-BANG INPUT (DEBUG): TokenStream [
43
Group {
54
delimiter: None,

src/test/ui/proc-macro/nested-macro-rules.stdout

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PRINT-BANG INPUT (DISPLAY): FirstStruct
1+
PRINT-BANG INPUT (DISPLAY): FirstStruct
22
PRINT-BANG INPUT (DEBUG): TokenStream [
33
Group {
44
delimiter: None,
@@ -12,7 +12,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
1212
},
1313
]
1414
PRINT-BANG INPUT (DISPLAY): SecondStruct
15-
PRINT-BANG RE-COLLECTED (DISPLAY): SecondStruct
1615
PRINT-BANG INPUT (DEBUG): TokenStream [
1716
Group {
1817
delimiter: None,

0 commit comments

Comments
 (0)