0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-25 16:49:29 -05:00

silence warning for unused 'must use' (#1269)

this warning only occurs when using the library as a dependency.

warning: unused return value of `Box::<T>::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
This commit is contained in:
Graham Abbott 2023-07-08 07:45:50 -07:00 committed by GitHub
parent ca83ce53ba
commit e2c6541ea3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}