Some previous discussion around this issue: Idea: Allow to query current optimization level using #[cfg(opt_level="..")]
In cryptographic implementations, it's often quite easy to trade performance for various things like smaller code size, lower stack usage, etc.
The question is how to gate such optimizations. I see based on the past discussion there was a lot of opposition to allowing some sort of introspection of
-Oz for this (e.g. a
#[small] attribute, perhaps?).
At the same time we have people complaining that something like a
compact cargo feature is an inappropriate use of cargo features.
An alternative I'm not sure which has been discussed is making this a property of individual targets, so it doesn't need to be explicitly configured by the end user.
What's the best way to solve this, now or prospectively?