Files
rust/tests/ui/proc-macro
Jonathan Brouwer e103550588 Rollup merge of #153308 - aytey:macro_meta_hygiene, r=jdonszelmann
Add hygiene annotations for tokens in `macro_rules!` bodies

`-Zunpretty=expanded,hygiene` was not printing syntax context annotations for identifiers and lifetimes inside `macro_rules!` bodies. These tokens are printed via `print_tt()` → `token_to_string_ext()`, which converts tokens to strings without calling `ann_post()`. This meant that macro-generated `macro_rules!` definitions with hygienic metavar parameters (e.g. multiple `$marg` distinguished only by hygiene) were printed with no way to tell them apart.

This was fixed by adding a match on `token.kind` in `print_tt()` to call `ann_post()` for `Ident`, `NtIdent`, `Lifetime`, and `NtLifetime` tokens, matching how `print_ident()` and `print_lifetime()` already handle AST-level identifiers and lifetimes.
2026-03-19 13:42:34 +01:00
..
2024-01-13 12:46:58 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2024-04-04 02:14:57 +01:00
2025-04-03 21:41:58 +00:00
2025-04-03 21:41:58 +00:00
2025-12-10 23:41:19 +00:00
2025-12-10 23:41:19 +00:00
2025-11-27 11:19:00 -05:00
2025-10-01 13:31:42 +08:00
2025-04-03 21:41:58 +00:00
2025-11-27 11:19:00 -05:00
2025-07-26 20:26:15 +02:00
2025-07-26 20:26:15 +02:00
2025-01-07 16:04:14 +01:00
2025-11-27 14:13:58 -05:00
2025-12-02 18:25:13 +00:00
2025-11-27 11:19:00 -05:00
2025-09-21 13:12:18 -04:00
2025-09-21 13:12:18 -04:00