Hi,
I'm on nightly and have this exact issue: WebAssembly multi-value return in today's Rust without wasm-bindgen | vmx - the blllog.
(ie. multivalue functions have weird argument count and no return value when returning a tuple).
Comment in wat:
;; features section: mutable-globals, bulk-memory, sign-ext, reference-types, multivalue
#[no_mangle]
pub fn flip(a: u32, b: u32) -> (u32, u32) {
(b, a)
}
(func $8 (param $0 i32) (param $1 i32) (param $2 i32)
(i32.store offset=4
(local.get $0)
(local.get $1)
)
(i32.store
(local.get $0)
(local.get $2)
)
)
Reading this blog post from a couple of days ago I would think multivalue should work ootb? WebAssembly targets: change in default target-features | Rust Blog
rustc 1.83.0-nightly (fa724e5d8 2024-09-27)
binary: rustc
commit-hash: fa724e5d8cbbdfbd1e53c4c656121af01b694406
commit-date: 2024-09-27
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0
I tried wasm32-wasip1
and wasm32-unknown-unknown