Skip to content

Breaking change in wasm32-unknown-unknown's ABI on nightly #81386

Closed
@alexcrichton

Description

@alexcrichton

Some tests in the wasm-bindgen project have started failing in nightly, and bisection points to #80594 as the culprit. The minimization of this looks like:

#[repr(C)]
pub struct Foo {
    pub a: u32,
    pub b: u32,
    pub c: u32,
}

#[no_mangle]
pub extern "C" fn foo(a: Foo) {}

where before this compiles as:

$ rustc +before foo.rs --crate-type cdylib --target wasm32-unknown-unknown -O && wasm2wat foo.wasm | grep 'func..foo'
  (func $foo (type 0) (param i32 i32 i32))
  (export "foo" (func $foo))
$ rustc +after foo.rs --crate-type cdylib --target wasm32-unknown-unknown -O && wasm2wat foo.wasm | grep 'func..foo'
  (func $foo (type 0) (param i32))
  (export "foo" (func $foo))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions