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(
(quote! {
#[no_mangle]
pub extern "C" fn #name(cx: *const ::wasm_bindgen_test::__rt::Context) {
unsafe {
let cx = &*cx;
let test_name = concat!(module_path!(), "::", stringify!(#ident));
#test_body
}
pub extern "C" fn #name(cx: &::wasm_bindgen_test::__rt::Context) {
let test_name = concat!(module_path!(), "::", stringify!(#ident));
#test_body
}
})
.into_iter(),