mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-25 22:22:12 +00:00
Remove unsafe from #[wasm_bindgen_test] output
This is not necessary because references are FFI-safe and compatible with corresponding pointers, so we can just use them directly as an input. Fixes #1540.
This commit is contained in:
parent
3e6d89f1cf
commit
cce12bfe16
@ -65,12 +65,9 @@ pub fn wasm_bindgen_test(
|
|||||||
tokens.extend(
|
tokens.extend(
|
||||||
(quote! {
|
(quote! {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn #name(cx: *const ::wasm_bindgen_test::__rt::Context) {
|
pub extern "C" fn #name(cx: &::wasm_bindgen_test::__rt::Context) {
|
||||||
unsafe {
|
let test_name = concat!(module_path!(), "::", stringify!(#ident));
|
||||||
let cx = &*cx;
|
#test_body
|
||||||
let test_name = concat!(module_path!(), "::", stringify!(#ident));
|
|
||||||
#test_body
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.into_iter(),
|
.into_iter(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user