In C++ you have compile flags to enable "Optimize debugging experience" using "-Og" or "/Og" (and possibly other flags on other compilers).
This flag enables very basic optimisations that don't interfere with the debugging experience (as far as I understand it). But it does mean that trivial or "free" optimisations made by the compiler are enabled for the program, which you then don't have to worry about.
From GCC optimise options, "Optimize debugging experience" is :
Optimize debugging experience. -Og should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience. It is a better choice than -O0 for producing debuggable code because some compiler passes that collect debug information are disabled at -O0.
I was wondering if there was an option somewhere to enable the same kind of benefits, or if any such options are planned. Ideally which can be enabled through cargo and in as cross-platform a manner as possible.
Note that I'm not asking about "opt-levels" which are the equivalent of "-O1, -02, etc".