Skip to content

Commit

Permalink
rust: Drop box ptr
Browse files Browse the repository at this point in the history
Because of this recent change to rust, our close function warned that
we calculate Box::from_raw but never use it.  I added the suggested
call to drop() around the function.

rust-lang/rust#99270
(cherry picked from commit 6836e4c)
  • Loading branch information
rwmjones committed Oct 14, 2022
1 parent ff2cfbd commit b3c721c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ mod ffi {

pub(super) extern fn close(selfp: *mut c_void) {
unsafe {
Box::from_raw(selfp as *mut Box<dyn Server>);
drop(Box::from_raw(selfp as *mut Box<dyn Server>));
}
}

Expand Down

0 comments on commit b3c721c

Please sign in to comment.