Skip to content

Commit

Permalink
Fix abi for wasm-bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jan 25, 2021
1 parent d3163e9 commit 4d2766e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2752,6 +2752,14 @@ where
attrs
});

if target.arch == "wasm32" && target.os == "unknown" {
// wasm-bindgen depends on ABI details and is incompatible with the
// correct C ABI, so this is being kept around until wasm-bindgen
// can be fixed to work with the correct ABI. See #63649 for further
// discussion.
arg.mode = PassMode::Direct(ArgAttributes::new());
}

if arg.layout.is_zst() {
// For some forsaken reason, x86_64-pc-windows-gnu
// doesn't ignore zero-sized struct arguments.
Expand Down

0 comments on commit 4d2766e

Please sign in to comment.