Skip to content

Commit c844028

Browse files
committed
Don't print additional spaces when pretty-printing NoDelim groups
1 parent 5da0576 commit c844028

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/librustc_ast_pretty/pprust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn token_kind_to_string_ext(tok: &TokenKind, convert_dollar_crate: Option<Span>)
245245
token::CloseDelim(token::Bracket) => "]".to_string(),
246246
token::OpenDelim(token::Brace) => "{".to_string(),
247247
token::CloseDelim(token::Brace) => "}".to_string(),
248-
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) => " ".to_string(),
248+
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) => "".to_string(),
249249
token::Pound => "#".to_string(),
250250
token::Dollar => "$".to_string(),
251251
token::Question => "?".to_string(),

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

-1
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

+1-2
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)