1ded7a5815
When a `macro_rules!` macro expands to another `macro_rules!` macro, we may see `None`-delimited groups in odd places when another crate deserializes the 'inner' macro. This commit 'unwraps' an outer `None`-delimited group to avoid breaking existing code. See https://github.com/rust-lang/rust/pull/73569#issuecomment-650860457 for more details. The proper fix is to handle `None`-delimited groups systematically throughout the parser, but that will require significant work. In the meantime, this hack lets us fix important hygiene bugs in macros
13 lines
327 B
Rust
13 lines
327 B
Rust
// aux-build:meta-delim.rs
|
|
// edition:2018
|
|
// run-pass
|
|
|
|
// Tests that we can properly deserialize a macro with strange delimiters
|
|
// See https://github.com/rust-lang/rust/pull/73569#issuecomment-650860457
|
|
|
|
extern crate meta_delim;
|
|
|
|
fn main() {
|
|
assert_eq!("a bunch of idents", meta_delim::meta_delim!(a bunch of idents));
|
|
}
|