We already allow derive macros and traits to share the same name, so that library users only need to use once:
use my_crate::MyTrait;
#[derive(MyTrait)]
struct MyStruct {
// ...
}
fn main() {
// ...
}
So we should also allow proc_macro_attribute and macro_rules with the same name, like:
use my_macro::my_macro;
#[my_macro]
struct MyStruct {
// ...
}
fn main() {
my_macro!(MyStruct);
}
Related: https://internals.rust-lang.org/t/allow-attribute-and-function-macros-to-share-name/19510 (closed)