Skip to content

Commit 94bf59e

Browse files
committed
Use correct ABI for wasm32 by default
Introduces `RUSTC_USE_WASM32_BINDGEN_COMPAT_ABI` env var to use the compat ABI if need.
1 parent 6526e5c commit 94bf59e

File tree

1 file changed

+6
-1
lines changed
  • compiler/rustc_target/src/abi/call

1 file changed

+6
-1
lines changed

compiler/rustc_target/src/abi/call/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,12 @@ impl<'a, Ty> FnAbi<'a, Ty> {
605605
"nvptx64" => nvptx64::compute_abi_info(self),
606606
"hexagon" => hexagon::compute_abi_info(self),
607607
"riscv32" | "riscv64" => riscv::compute_abi_info(cx, self),
608-
"wasm32" if cx.target_spec().os != "emscripten" => {
608+
"wasm32"
609+
if cx.target_spec().os != "emscripten"
610+
&& std::env::var("RUSTC_USE_WASM32_BINDGEN_COMPAT_ABI")
611+
.map(|x| &x != "0")
612+
.unwrap_or(false) =>
613+
{
609614
wasm32_bindgen_compat::compute_abi_info(self)
610615
}
611616
"wasm32" | "asmjs" => wasm32::compute_abi_info(cx, self),

0 commit comments

Comments
 (0)