[Pre-RFC] Allow attributes to be applied to generic arguments
Rust Internals [Unofficial]
March 27, 2026
Keep in mind that while features are intended to be additive, not all usage of cfg-attributes has to be. In particular, custom conditionals have no such requirement or implication.
Something like:
// Note, not #[cfg(feature = "foo")]
struct Foo {
// ..
}
could certainly happen in some codebases.
Discussion in the ATmosphere