Open pravic opened 6 years ago
Also there is a proc-macro-hack for function-like macros, but it can't be used inside impl blocks and can't contain more than one declaration within the same scope.
As for custom attributes (which seem the most convenient) — they haven't been stabilized yet. But available on nightly though.
Attributes are available now (since Rust 1.30). Need to check them out.
Something like this:
However it does not seem possible. Apparently, Macros 1.1 allow only type-level attributes.