-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Exporting bigint slices panics #3461
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Can you reproduce this error? It would be good to file an issue for Rust so the regression can be addressed. |
It's pretty easy to reproduce, I made a whole example here: https://github.com/daxpedda/wasm-bindgen-bigint-slice-issue. I don't think it's a Rust issue, but it definitely goes over my head. I don't know enough about the Rust/ |
It looks like this is happening because Lines 1571 to 1588 in 5453e33
The best fix is probably to add an |
As of Rust v1.70, exporting a function like this:
... will make it panic when called from JS:
Here is a minimal reproducible example:
https://github.com/daxpedda/wasm-bindgen-bigint-slice-issue
I confirmed the following scenarios:
u64
andi64
integer types cause this issue.-Ctarget-feature=-sign-ext,-mutable-globals
and-Zbuild-std
on nightly-2023-06-03 does not fix the issue.-Ctarget-feature=+sign-ext,+mutable-globals
on Rust v1.69 does not cause this issue.This issue was originally discovered here: https://github.com/rustwasm/wasm-bindgen/actions/runs/5176047134/jobs/9324382988#step:7:409.
Update: apparently the bug is coming from rust-lang/rust#98112.
It's possible to circumvent the check by just disabling
debug_assert
s.The text was updated successfully, but these errors were encountered: