Attribute Macro stageleft::top_level_mod

source ·
#[top_level_mod]
Expand description

A utility for declaring top-level public modules in a Stageleft crate that exports macros.

This gets around errors in compiling the macro crate when there are pub mod declarations at the top-level file.

This macro will only work on nightly with #![feature(proc_macro_hygiene)], but for stable builds you can manually achieve this by using the following pattern:

#[cfg(not(stageleft_macro))]
pub mod my_mod;

#[cfg(stageleft_macro)]
mod my_mod;