Consider the following example from dtolnay/request-for-implementation#6
r#"
#[cfg(feature = "m1")]
mod m1;
#[cfg_attr(feature = "m2", path = "m2.rs")]
#[cfg_attr(not(feature = "m2"), path = "empty.rs")]
mod placeholder;
According to that ticket, this should expand to two declarations of mod placeholder, with the cfg_attr being converted to a normal cfg attribute.
I'm not sure this is worth the complexity it creates. Consider the following case:
#[cfg_attr(feature = "foo", path = "m2")]
#[cfg_attr(not(feature = "foo"), path = "m3")]
mod outer {
#[cfg_attr(feature = "foo", path = "baz.rs")]
#[cfg_attr(not(feature = "foo"), path = "bar.rs")]
mod placeholder;
}
We'd need to emit outer twice, with placeholder twice inside.
Consider the following example from dtolnay/request-for-implementation#6
According to that ticket, this should expand to two declarations of
mod placeholder, with thecfg_attrbeing converted to a normalcfgattribute.I'm not sure this is worth the complexity it creates. Consider the following case:
We'd need to emit
outertwice, withplaceholdertwice inside.