Skip to content

Commit

Permalink
Don't print additional spaces when pretty-printing NoDelim groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Jul 1, 2020
1 parent 5da0576 commit c844028
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustc_ast_pretty/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ fn token_kind_to_string_ext(tok: &TokenKind, convert_dollar_crate: Option<Span>)
token::CloseDelim(token::Bracket) => "]".to_string(),
token::OpenDelim(token::Brace) => "{".to_string(),
token::CloseDelim(token::Brace) => "}".to_string(),
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) => " ".to_string(),
token::OpenDelim(token::NoDelim) | token::CloseDelim(token::NoDelim) => "".to_string(),
token::Pound => "#".to_string(),
token::Dollar => "$".to_string(),
token::Question => "?".to_string(),
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/proc-macro/input-interpolated.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PRINT-BANG INPUT (DISPLAY): A
PRINT-BANG RE-COLLECTED (DISPLAY): A
PRINT-BANG INPUT (DEBUG): TokenStream [
Group {
delimiter: None,
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/proc-macro/nested-macro-rules.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PRINT-BANG INPUT (DISPLAY): FirstStruct
PRINT-BANG INPUT (DISPLAY): FirstStruct
PRINT-BANG INPUT (DEBUG): TokenStream [
Group {
delimiter: None,
Expand All @@ -12,7 +12,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
},
]
PRINT-BANG INPUT (DISPLAY): SecondStruct
PRINT-BANG RE-COLLECTED (DISPLAY): SecondStruct
PRINT-BANG INPUT (DEBUG): TokenStream [
Group {
delimiter: None,
Expand Down

0 comments on commit c844028

Please sign in to comment.