mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-01 12:37:37 +00:00

This involves replacing `nt_pretty_printing_compatibility_hack` with `stream_pretty_printing_compatibility_hack`. The handling of statements in `transcribe` is slightly different to other nonterminal kinds, due to the lack of `from_ast` implementation for empty statements. Notable test changes: - `tests/ui/proc-macro/expand-to-derive.rs`: the diff looks large but the only difference is the insertion of a single invisible-delimited group around a metavar.
12 lines
348 B
Rust
12 lines
348 B
Rust
//@ check-pass
|
|
//
|
|
// This shows a tricky case for #124141, where `declare!(_x)` was incorrectly
|
|
// being categorised as a `StmtKind::Expr` instead of a `StmtKind::MacCall` in
|
|
// `parse_stmt_mac`.
|
|
|
|
macro_rules! as_stmt { ($s:stmt) => { $s }; }
|
|
|
|
macro_rules! declare { ($name:ident) => { let $name = 0u32; }; }
|
|
|
|
fn main() { as_stmt!(declare!(_x)); }
|