Skip to content

wasm abi warning #4677

Description

@BlackStone1123

I annotate my function with #[wasm_bindgen] attribute macro, and I bump my rust toolchain to channel "nightly-2025-04-04". Now the compiler warning me the upcoming ABI change, and it will cause a hard error in future release. The warning is like this:

warning: this function definition involves an argument of type () which is affected by the wasm ABI transition
--> ffi\wasm-api\src\scene_view.rs:54:1
|
54 | #[wasm_bindgen]
| ^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #138762 rust-lang/rust#138762
= help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target
= note: this warning originates in the attribute macro wasm_bindgen (in Nightly builds, run with -Z macro-backtrace for more info)

my function is like this:
#[wasm_bindgen]
pub fn screen_pixel_cast_ray(reader: &WasmSceneReader, x: f32, y: f32, out: &mut [f32]) -> bool {
unr_3d_api::scene_view_cast_ray(reader, (x, y))
.map(|v| {
out[0] = v.origin.x;
out[1] = v.origin.y;
out[2] = v.origin.z;
out[3] = v.direction.x;
out[4] = v.direction.y;
out[5] = v.direction.z;
})
.is_some()
}

I can not figure out which parameter caused this warning ,and how to work this warning around?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions