Make the wasm_c_abi future compat warning a hard error by bjorn3 · Pull Request #133951 · rust-lang/rust (original) (raw)
To summarize even more summarily for T-lang:
extern "C" fn
on wasm32 targets has used a creative ABI that emerged because Rust and C toolchain development were more historically contemporary to each other, as opposed to the usual "first C, then 10~40 years later, Rust". Unfortunately, wasm-bindgen needed something for a stable-ish wasm ABI to talk to JavaScript. A flawed lowering was written. It was not immediately fixed because fixing it would break wasm-bindgen. For a while the wasm32-unknown-emscripten target was an acceptable workaround, and in a nascent ecosystem which might have further growing pains, the next move was not obvious.
Things have settled and it has become clear that Rust should align the ABI of extern "C" fn
with that used by C toolchains for other wasm32 targets.
Thanks to @alexcrichton and @daxpedda we have implemented a relatively-smooth migration path for wasm-bindgen. There should be no meaningful concerns going forward, and this will make code that wasn't compatible with C code be compatible again, according to the conventional understanding of extern "C" fn
.