Pre-RFC: Mutually-excusive, global features

FWIW, I would very much like to see this happen and am currently available as a freelancer. If you work for or know of some organization that would be interested in funding this, please contact me. (I have previously made several contributions to Cargo and wrote two accepted Rust RFCs.)

4 Likes

another usecase to consider: controlling what size of integer is used for a certain id type.

currently this can be implemented by having multiple features representing different integer widths, and using the largest value.

it's worth noting that this doesn't actually require any changes to rustc. indeed, features themselves don't require rustc support. it's just a standardized case of the cfg system.

It would be amazing if globals wasn't limited to enums. In the embedded world you might for example wrap an sdk that lets you configure the number of Bluetooth connections with a define in a c-header. I would like that to be configurable by the app crate and not the sdk-wrapper.