From b17a734a5722a8cb9205b14575ca13eb13a59677 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 9 Aug 2022 13:17:43 -0700 Subject: [PATCH] Fix unused result that is `#[must_use]` (#4663) Fixes this compiler warning: ``` warning: unused return value of `Box::::from_raw` that must be used --> crates/bench-api/src/lib.rs:351:9 | 351 | Box::from_raw(state as *mut BenchState); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ``` --- crates/bench-api/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bench-api/src/lib.rs b/crates/bench-api/src/lib.rs index 0806f43bb6..72b27116fa 100644 --- a/crates/bench-api/src/lib.rs +++ b/crates/bench-api/src/lib.rs @@ -348,7 +348,7 @@ pub extern "C" fn wasm_bench_create( pub extern "C" fn wasm_bench_free(state: *mut c_void) { assert!(!state.is_null()); unsafe { - Box::from_raw(state as *mut BenchState); + drop(Box::from_raw(state as *mut BenchState)); } }