Proc macros should be expandable independently and without any side effects. We don't offer any guarantees around the order and amount of times a proc macro is expanded. For example rust-analyzer will only re-expand proc macros if you change the actual invocation of the proc macro. Rustc could also start caching proc macro outputs in the future I think.
bjorn3
6
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
|
Interaction between independent proc macros via file I/O
|
3 | 140 | February 23, 2026 | |
| Simple "state" in procedural macro | 8 | 3070 | December 3, 2021 | |
| Keeping a state within a procedural macro | 4 | 820 | May 11, 2023 | |
| What the 'life cycle' of a proc-macro could be? | 1 | 200 | June 7, 2024 | |
| Is there a way let macros at different place communicate? | 17 | 840 | August 25, 2024 |