::cfg_eval

#[cfg_eval] in stable Rust.

Repository Latest version Documentation MSRV unsafe forbidden License CI

Example

```rust use ::macrorulesattribute::apply;

[macro_use]

extern crate cfg_eval;

fn main() { let outputwithoutcfg_eval = { #[apply(stringify!)] enum Foo { Bar,

        #[cfg(FALSE)]
        NonExisting,
    }
};
// This is usually not great.
assert!(output_without_cfg_eval.contains("NonExisting"));

let output_with_cfg_eval = {
    #[cfg_eval]
    #[apply(stringify!)]
    enum Foo {
        Bar,

        #[cfg(FALSE)]
        NonExisting,
    }
};
assert_eq!(output_with_cfg_eval, stringify! {
    enum Foo {
        Bar,
    }
});

} ```