danielhenrymantilla / macro_rules_attribute-rs

Use declarative macros as proc_macro attributes or derives
https://docs.rs/macro-rules-attribute
Apache License 2.0
97 stars 9 forks source link

attribute_alias! (and derive_alias!) don't do public visibility #16

Open OriDevTeam opened 1 year ago

OriDevTeam commented 1 year ago

So i have an attribute alias on a macro crate and i want to use it on another crate, but when i try to use it, it doesn't find it

seripack_macros::lib.rs

attribute_alias! {
    #[apply(packet_setup!)] =
        #[derive(Packet, Pod, Zeroable, Default, Debug, Copy, Clone)]
        #[repr(C)]
    ;
}

in seripack::tests::mod.rs

use seripack_macros::packet_setup;

gives me 
12 | use seripack_macros::packet_setup;
   |                      ^^^^^^^^^^^^ no `packet_setup` in the root

This is also the case with derive_alias i presume as hinted by the author.

Best regards.

danielhenrymantilla commented 1 year ago

Ah yeah, currently the _alias!es are designed to be pub(crate) only, for some technical reasons. I'll think about the best way to offer an opt-in for pub ones.