Skip to content

use new (1.30.0) stable rust feature #[macro_export(local_inner_macros)] #159

@softprops

Description

@softprops

announced here rust is updating the way users access exported macros and the way macro authors export them noted in the release notes

You can now import and reexport macros from other crates with the use syntax. Macros exported with #[macro_export] are now placed into the root module of the crate. If your macro relies on calling other local macros, it is recommended to export with the #[macro_export(local_inner_macros)] attribute so users won't have to import those macros.

pending docs for this feature live here

I've started experimenting with this in the rust crowbar crate but have found that in practice it may require this crate to use the local_inner_macros way of exporting macros so crowbar users won't have to use this crates helper macros explicitly iliana/rust-crowbar#46 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions