style: Change some references to raw pointers in some FFI functions

Even tho https://github.com/rust-lang/rust/issues/112337 is IMO a rust
bug, it's easy to work around in our code and it doesn't really affect
expressiveness.

Differential Revision: https://phabricator.services.mozilla.com/D180065
This commit is contained in:
Emilio Cobos Álvarez 2023-06-06 09:06:15 +00:00 committed by Martin Robinson
parent e792eba7c7
commit 52e2cc5ff0

View file

@ -23,12 +23,12 @@ use servo_arc::Arc;
macro_rules! impl_simple_arc_ffi {
($ty:ty, $addref:ident, $release:ident) => {
#[no_mangle]
pub unsafe extern "C" fn $addref(obj: &$ty) {
pub unsafe extern "C" fn $addref(obj: *const $ty) {
std::mem::forget(Arc::from_raw_addrefed(obj));
}
#[no_mangle]
pub unsafe extern "C" fn $release(obj: &$ty) {
pub unsafe extern "C" fn $release(obj: *const $ty) {
let _ = Arc::from_raw(obj);
}
};