I think it could be useful to add support for
#[cfg(const_eval)], which would enable code only during const evaluation. Possible uses:
- cleaning up some APIs for runtime while retaining APIs for const evaluation by annotating whole functions
- panicking easily during const evaluation and pushing hard during runtime by annotating blocks of code
- using faster or better algorithms on runtime, that require using non-const functions by annotating blocks of code
Would it be useful? Is it realistically possible to implement? Is it worth writing an RFC?