about summary refs log tree commit diff
path: root/src/libsyntax/fold.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-05-22 08:01:21 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-05-22 11:56:41 -0700
commita137d00ce52e9db78bb803d1384fdf3a4c4e63ea (patch)
treef262aeefdcdae7d68afcc9eb797e579b7aed7dbd /src/libsyntax/fold.rs
parentff8fa5cc69db5567b32ceca1ee4ac0dcfa3a81bc (diff)
downloadrust-a137d00ce52e9db78bb803d1384fdf3a4c4e63ea.tar.gz
rust-a137d00ce52e9db78bb803d1384fdf3a4c4e63ea.zip
rustc: Correctly pretty-print macro delimiters
This commit updates the `Mac_` AST structure to keep track of the delimiters
that it originally had for its invocation. This allows us to faithfully
pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in
turn helps procedural macros due to #43081.

Closes #50840
Diffstat (limited to 'src/libsyntax/fold.rs')
-rw-r--r--src/libsyntax/fold.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index 28fb95f165f..190fef2a997 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -520,6 +520,7 @@ pub fn noop_fold_mac<T: Folder>(Spanned {node, span}: Mac, fld: &mut T) -> Mac {
         node: Mac_ {
             tts: fld.fold_tts(node.stream()).into(),
             path: fld.fold_path(node.path),
+            delim: node.delim,
         },
         span: fld.new_span(span)
     }