Declarative macro re-invocation using `self!`, and macro arm privacy
Rust Internals
Declarative macro re-invocation using `self!`, and macro arm privacy
Sometimes a macro needs to use a helper macro to perform some operation (e.g. summing the number of items passed in). Declaring and exporting a secondary helper macro unfortunately allows a downstream crate to depend upon it (e.g. if they manually expand one level of the macro it'll contain a use of the hidden helper macro). macro_rules! reflect_struct { // This delegates the field parsing to other arms so it doesn't have to // reconstruct the fields (which is impossible if it matches on an...
0 comments
No comments yet.