about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/lib.rs
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-08-21 17:52:52 -0400
committerAaron Hill <aa1ronham@gmail.com>2020-09-10 17:33:05 -0400
commitde4bd9f0f8aeb4b89e55ba33b755c9a93e999e1c (patch)
tree05cc6034e654ed16e2c7c7dfc5e6f8999b1a2223 /compiler/rustc_parse/src/lib.rs
parentad3a6f70ac9457173aa1f3f3af372aadec915f8d (diff)
Attach `TokenStream` to `ast::Block`
A `Block` does not have outer attributes, so we only capture tokens when
parsing a `macro_rules!` matcher
Diffstat (limited to 'compiler/rustc_parse/src/lib.rs')
-rw-r--r--compiler/rustc_parse/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs
index 12afc48356c..65ded67dcf6 100644
--- a/compiler/rustc_parse/src/lib.rs
+++ b/compiler/rustc_parse/src/lib.rs
@@ -268,6 +268,7 @@ pub fn nt_to_tokenstream(nt: &Nonterminal, sess: &ParseSess, span: Span) -> Toke
         Nonterminal::NtItem(ref item) => {
             prepend_attrs(sess, &item.attrs, item.tokens.as_ref(), span)
         }
+        Nonterminal::NtBlock(ref block) => block.tokens.clone(),
         Nonterminal::NtPat(ref pat) => pat.tokens.clone(),
         Nonterminal::NtIdent(ident, is_raw) => {
             Some(tokenstream::TokenTree::token(token::Ident(ident.name, is_raw), ident.span).into())