Skip to content

Commit

Permalink
style: Change some references to raw pointers in some FFI functions
Browse files Browse the repository at this point in the history
Even tho rust-lang/rust#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
  • Loading branch information
emilio authored and Loirooriol committed Nov 23, 2023
1 parent 0f7ebf5 commit d2b14a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/style/gecko/arc_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down

0 comments on commit d2b14a7

Please sign in to comment.