From e2c6541ea3845d1f6d47e60bd99c368d672e25ed Mon Sep 17 00:00:00 2001 From: Graham Abbott Date: Sat, 8 Jul 2023 07:45:50 -0700 Subject: [PATCH] silence warning for unused 'must use' (#1269) this warning only occurs when using the library as a dependency. warning: unused return value of `Box::::from_raw` that must be used --> /rusty_v8/src/scope.rs:1092:16 | 1092 | unsafe { Box::from_raw(root) }; | ^^^^^^^^^^^^^^^^^^^ | = note: call `drop(Box::from_raw(ptr))` if you intend to drop the `Box` = note: `#[warn(unused_must_use)]` on by default --- src/scope.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scope.rs b/src/scope.rs index 04542db4..8ccfadc6 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -1089,7 +1089,9 @@ pub(crate) mod data { /// This function should be called only when an Isolate is being disposed. pub(crate) fn drop_root(isolate: &mut Isolate) { let root = Self::get_root_mut(isolate); - unsafe { Box::from_raw(root) }; + unsafe { + let _ = Box::from_raw(root); + }; isolate.set_current_scope_data(None); }