Skip to content

Commit 4d2766e

Browse files
committed
Fix abi for wasm-bindgen
1 parent d3163e9 commit 4d2766e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_middle/src/ty/layout.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,6 +2752,14 @@ where
27522752
attrs
27532753
});
27542754

2755+
if target.arch == "wasm32" && target.os == "unknown" {
2756+
// wasm-bindgen depends on ABI details and is incompatible with the
2757+
// correct C ABI, so this is being kept around until wasm-bindgen
2758+
// can be fixed to work with the correct ABI. See #63649 for further
2759+
// discussion.
2760+
arg.mode = PassMode::Direct(ArgAttributes::new());
2761+
}
2762+
27552763
if arg.layout.is_zst() {
27562764
// For some forsaken reason, x86_64-pc-windows-gnu
27572765
// doesn't ignore zero-sized struct arguments.

0 commit comments

Comments
 (0)