I find macro_rules! easier to work with compared to proc macros and I've seen many instances of this pattern:
macro_rules! rewrite {
...
}
rewrite! {
struct T { }
}
However, I think the attribute syntax is preferable when it comes to processing declarations:
#[rewrite]
struct T {}
Today, this is easy to work around: either define rewrite as proc_macro_attribute and wrap the input, or define a general proc macro #[macro(rewrite)] to be used for any macro rules which works but there will be some boilerplate to manage.
The idea is to make it possible to apply macro rules directly to items:
#[rewrite!]
struct T {}
So that you can match any kind of items in the rules one by one and rewrite.