rust/compiler/rustc_parse/src/parser
Aaron Hill f94360fd83
Always preserve None-delimited groups in a captured TokenStream
Previously, we would silently remove any `None`-delimiters when
capturing a `TokenStream`, 'flattenting' them to their inner tokens.
This was not normally visible, since we usually have
`TokenKind::Interpolated` (which gets converted to a `None`-delimited
group during macro invocation) instead of an actual `None`-delimited
group.

However, there are a couple of cases where this becomes visible to
proc-macros:
1. A cross-crate `macro_rules!` macro has a `None`-delimited group
   stored in its body (as a result of being produced by another
   `macro_rules!` macro). The cross-crate `macro_rules!` invocation
   can then expand to an attribute macro invocation, which needs
   to be able to see the `None`-delimited group.
2. A proc-macro can invoke an attribute proc-macro with its re-collected
   input. If there are any nonterminals present in the input, they will
   get re-collected to `None`-delimited groups, which will then get
   captured as part of the attribute macro invocation.

Both of these cases are incredibly obscure, so there hopefully won't be
any breakage. This change will allow more agressive 'flattenting' of
nonterminals in #82608 without losing `None`-delimited groups.
2021-03-26 23:32:18 -04:00
..
attr.rs Address review comments 2021-02-13 13:04:54 -05:00
attr_wrapper.rs Always preserve None-delimited groups in a captured TokenStream 2021-03-26 23:32:18 -04:00
diagnostics.rs Emit more pretty diagnostics for qualified paths 2021-03-17 09:57:58 +09:00
expr.rs Avoid double-collection for expression nonterminals 2021-03-25 18:05:49 -04:00
generics.rs Require passing an AttrWrapper to collect_tokens_trailing_token 2021-02-13 12:07:15 -05:00
item.rs Auto merge of #76447 - pickfire:async-pub, r=estebank 2021-03-18 02:32:39 +00:00
mod.rs Always preserve None-delimited groups in a captured TokenStream 2021-03-26 23:32:18 -04:00
nonterminal.rs Avoid double-collection for expression nonterminals 2021-03-25 18:05:49 -04:00
pat.rs stabilize or_patterns 2021-03-19 19:45:32 -05:00
path.rs Fix turbofish recovery with multiple generic args 2021-02-27 13:46:49 +03:00
stmt.rs stabilize or_patterns 2021-03-19 19:45:32 -05:00
ty.rs Add pub as optional check_front_matter 2021-03-17 09:04:08 +08:00