Re-exporting macros

⚓ rust    📅 2025-05-23    👤 surdeus    👁️ 4      

surdeus

Warning

This post was published 37 days ago. The information described in this article may have changed.

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Re-exporting macros

I'd like to do something like this:

macros_for_type_A.rs is a file that re-exports macros defined in various files. Then other files relevant to this type can simply do use macros_for_type_A::* and get the macros they need.

My understanding is that #[macro_export] makes macros globally available; is there a more modest alternative similar to functions? And with this one would always have to call them as macros_for_type_A.rs::macro!() rather than macro!() ?

4 posts - 3 participants

Read full topic

🏷️ rust_feed