diff --git a/cranelift/object/tests/basic.rs b/cranelift/object/tests/basic.rs index 508947b2e5..cf5eca5273 100644 --- a/cranelift/object/tests/basic.rs +++ b/cranelift/object/tests/basic.rs @@ -200,7 +200,7 @@ fn libcall_function() { #[test] #[should_panic( - expected = "Result::unwrap()` on an `Err` value: Backend(Symbol \"function\\u{0}with\\u{0}nul\\u{0}bytes\" has a null byte, which is disallowed" + expected = "Result::unwrap()` on an `Err` value: Backend(Symbol \"function\\0with\\0nul\\0bytes\" has a null byte, which is disallowed" )] fn reject_nul_byte_symbol_for_func() { let flag_builder = settings::builder(); @@ -224,7 +224,7 @@ fn reject_nul_byte_symbol_for_func() { #[test] #[should_panic( - expected = "Result::unwrap()` on an `Err` value: Backend(Symbol \"data\\u{0}with\\u{0}nul\\u{0}bytes\" has a null byte, which is disallowed" + expected = "Result::unwrap()` on an `Err` value: Backend(Symbol \"data\\0with\\0nul\\0bytes\" has a null byte, which is disallowed" )] fn reject_nul_byte_symbol_for_data() { let flag_builder = settings::builder(); diff --git a/crates/c-api/src/func.rs b/crates/c-api/src/func.rs index daf38bd5df..bdc9df36a9 100644 --- a/crates/c-api/src/func.rs +++ b/crates/c-api/src/func.rs @@ -265,7 +265,7 @@ pub(crate) unsafe fn c_callback_to_rust_fn( // Translate the `wasmtime_val_t` results into the `results` space for (i, result) in out_results.iter().enumerate() { - results[i] = unsafe { result.to_val() }; + results[i] = result.to_val(); } // Move our `vals` storage back into the store now that we no longer