about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/builder.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-03-27 20:37:12 +0100
committerGitHub <noreply@github.com>2021-03-27 20:37:12 +0100
commit1115acccccd8d5e9255aebf6d787ab118687be3b (patch)
treefcab4e0de8e12de64a66e2e55f266b964106efc4 /compiler/rustc_codegen_llvm/src/builder.rs
parentaee7b9e7d64f446847e5c18649c88e3267130a6d (diff)
parentf94360fd83b49554b6c26999a0030e9cfe800f32 (diff)
downloadrust-1115acccccd8d5e9255aebf6d787ab118687be3b.tar.gz
rust-1115acccccd8d5e9255aebf6d787ab118687be3b.zip
Rollup merge of #83548 - Aaron1011:capture-none-delims, r=petrochenkov
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
0 files changed, 0 insertions, 0 deletions