eval_block!() { /* proc-macro */ }
Expand description

Equivalent to #[eval] but does not have restrictions on where it can be attached.

Examples

Compiled using the example alias file.

Non-inline modules can be annotated:

attr_alias::eval_block! {
    #[attr_alias(macos, cfg_attr(*, path = "sys/macos.rs"))]
    #[attr_alias(macos, cfg_attr(not(*), path = "sys/common.rs"))]
    mod sys;
}

Using #[eval] would require a nightly feature:

#![feature(proc_macro_hygiene)]

#[attr_alias::eval]
#[attr_alias(macos, cfg_attr(*, path = "sys/macos.rs"))]
#[attr_alias(macos, cfg_attr(not(*), path = "sys/common.rs"))]
mod sys;