Can't get multivalue wasm to work

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

The blog you link says it doesn't. ("out on the horizon")

It is announcing breaking change in Rust 1.82. And how to use nightly if you need a new compiler while still having support for MVP.

Right, but it used to work a year ago, see:

Of course this is all nightly, so regressions are to be expected? I'm just wondering if I'm doing it wrong and it works for you.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.