-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels