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:
Ingvar Stepanyan 2019-05-17 15:52:26 +01:00
parent 3e6d89f1cf
commit cce12bfe16

View File

@ -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(),