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.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Simple "state" in procedural macro | 9 | 2533 | March 3, 2022 | |
Help with proc macros | 5 | 579 | September 26, 2019 | |
Is it okay to `use` in derive proc macros? | 2 | 570 | February 3, 2023 | |
Beginner proc macro questions | 2 | 276 | October 19, 2022 | |
Macro to collect metadata | 11 | 800 | August 10, 2022 |