macro_rules_attribute-rs icon indicating copy to clipboard operation
macro_rules_attribute-rs copied to clipboard

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

Open OriDevTeam opened this issue 2 years ago • 1 comments

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.

OriDevTeam avatar Jan 08 '23 06:01 OriDevTeam

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.

danielhenrymantilla avatar May 09 '23 19:05 danielhenrymantilla