about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2021-07-03 15:10:06 -0700
committerNoah Lev <camelidcamel@gmail.com>2021-07-03 16:35:18 -0700
commit7ffec7028a54aeed6076f7043734b682fdf68f6e (patch)
treeaa93358eca68daf1dac0d9c6c8cde769bcb534bf /compiler
parentf82d4845f219357c80ed68a6391d0bf00611f228 (diff)
downloadrust-7ffec7028a54aeed6076f7043734b682fdf68f6e.tar.gz
rust-7ffec7028a54aeed6076f7043734b682fdf68f6e.zip
rustc_ast_pretty: Don't print space after `$`
For example, this code:

    $arg:expr

used to be pretty-printed as:

    $ arg : expr

but is now pretty-printed as:

    $arg : expr
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs
index f14d8a693fd..8b7b306a54d 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state.rs
@@ -136,11 +136,11 @@ pub fn print_crate<'a>(
     s.s.eof()
 }
 
-// This makes printed token streams look slightly nicer,
-// and also addresses some specific regressions described in #63896 and #73345.
+/// This makes printed token streams look slightly nicer,
+/// and also addresses some specific regressions described in #63896 and #73345.
 fn tt_prepend_space(tt: &TokenTree, prev: &TokenTree) -> bool {
     if let TokenTree::Token(token) = prev {
-        if matches!(token.kind, token::Dot) {
+        if matches!(token.kind, token::Dot | token::Dollar) {
             return false;
         }
         if let token::DocComment(comment_kind, ..) = token.kind {