The conditional if cfg!(...) for platform specific optimization was evaluated at run time. Due to this, all the branches are compiled and the asm! macro fails on incompatible platform. This only happens in debug as in release the incompatible branches are optimized out early. This also used to work in previous rust versions, so possibly a change in asm! or in the debug optimization broke it.
Rewrite this platform specific code in a way that everything is evaluated at build time, by having conditional blocks with early returns instead of runtime if/else.
The conditional
if cfg!(...)
for platform specific optimization was evaluated at run time. Due to this, all the branches are compiled and theasm!
macro fails on incompatible platform. This only happens in debug as in release the incompatible branches are optimized out early. This also used to work in previous rust versions, so possibly a change inasm!
or in the debug optimization broke it.Rewrite this platform specific code in a way that everything is evaluated at build time, by having conditional blocks with early returns instead of runtime if/else.