4 ms·
asm! has been an unstable feature for years, which means a) it's available only in nightly builds, and b) there is no guarantee that it will remain backwards-co
by jcranmer 6y ago
asm! has been an unstable feature for years, which means a) it's available only in nightly builds, and b) there is no guarantee that it will remain backwards-compatible.
Actually, with regards to asm!, it's been known for a long time that it was unlikely to be stabilized as-is (being originally a very thin wrapper around LLVM's inline asm functionality). Probably nearly everyone who's been relying on inline asm to make their code work has already been following the effort to replace asm! with a better version.
- gpm 6y agoc) Even on nightly builds you need to put #![feature(asm)] at the root of your crate to use it. (Likewise for all unstable features, just replace asm with feature_name.)
- twic 6y ago> Probably nearly everyone who's been relying on inline asm to make their code work has already been following the effort to replace asm! with a better version Except for my colleague who basically says "nah, they'll never be able to move off the LLVM syntax, the code i'm writing now will be supported forever". Fortunately, we only have a small amount of assembly, so if we ever do want to upgrade to a version of the compiler which has dropped support, it won't be a lot of work.
- dathinab 6y agoSupport will likely not be dropped anytime soon, maybe never. You just need to rename it to `llvm_asm!`. Through with `asm!` likely going to be stabilized while `llvm_asm` never going to be stabilized it might be worthwhile to switch to the new asm to get of nightly in the future ;=)