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
..
2025-11-27 11:19:00 -05:00
2023-04-03 09:24:11 +02:00
2025-12-02 18:25:13 +00:00
2023-04-03 09:24:11 +02:00
2023-04-03 09:24:11 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2026-01-27 18:11:52 +03:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2026-01-14 19:58:33 +03:00
2026-01-14 19:58:33 +03:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2026-01-08 19:14:45 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-04-03 09:24:11 +02:00
2023-04-03 09:24:11 +02:00
2023-11-24 19:15:52 +01:00
2026-01-13 08:47:48 +01:00
2025-12-02 18:25:13 +00:00
2026-01-08 19:14:45 +01:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-04-03 09:24:11 +02:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2024-02-16 20:02:50 +00:00
2025-09-26 15:33:48 +02:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-11-27 11:19:00 -05:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2026-02-17 16:51:44 +00:00
2026-02-17 16:51:44 +00:00
2025-12-18 21:18:05 +01:00
2025-09-25 20:52:03 +02:00
2025-12-04 14:58:46 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2026-01-08 19:14:45 +01:00
2025-12-09 17:29:23 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2026-01-29 12:07:01 +00:00
2026-03-02 20:28:16 +00:00
2026-03-03 13:06:55 +00:00
2026-03-03 13:06:55 +00:00
2026-03-03 13:06:55 +00:00
2026-03-03 13:06:55 +00:00
2024-12-27 19:58:16 +11:00
2026-03-02 20:28:16 +00:00
2024-02-16 20:02:50 +00:00
2026-03-04 08:06:45 +08:00