From 42cbb9d3cf291896b4a2cedf1b13ebad6ff4a8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 9 May 2023 22:38:34 +0000 Subject: [PATCH] style: Remove HasSimpleFFI It's completely unsused and we don't want to use it any time soon, see bug 1831539 and related. Differential Revision: https://phabricator.services.mozilla.com/D177497 --- .../style/gecko_bindings/sugar/ownership.rs | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/components/style/gecko_bindings/sugar/ownership.rs b/components/style/gecko_bindings/sugar/ownership.rs index 9579e291127..2d0e9819b8c 100644 --- a/components/style/gecko_bindings/sugar/ownership.rs +++ b/components/style/gecko_bindings/sugar/ownership.rs @@ -19,43 +19,6 @@ pub unsafe trait HasFFI: Sized + 'static { type FFIType: Sized; } -/// Indicates that a given Servo type has the same layout as the corresponding -/// `HasFFI::FFIType` type. -pub unsafe trait HasSimpleFFI: HasFFI { - #[inline] - /// Given a Servo-side reference, converts it to an FFI-safe reference which - /// can be passed to Gecko. - /// - /// &ServoType -> &GeckoType - fn as_ffi(&self) -> &Self::FFIType { - unsafe { transmute(self) } - } - #[inline] - /// Given a Servo-side mutable reference, converts it to an FFI-safe mutable - /// reference which can be passed to Gecko. - /// - /// &mut ServoType -> &mut GeckoType - fn as_ffi_mut(&mut self) -> &mut Self::FFIType { - unsafe { transmute(self) } - } - #[inline] - /// Given an FFI-safe reference obtained from Gecko converts it to a - /// Servo-side reference. - /// - /// &GeckoType -> &ServoType - fn from_ffi(ffi: &Self::FFIType) -> &Self { - unsafe { transmute(ffi) } - } - #[inline] - /// Given an FFI-safe mutable reference obtained from Gecko converts it to a - /// Servo-side mutable reference. - /// - /// &mut GeckoType -> &mut ServoType - fn from_ffi_mut(ffi: &mut Self::FFIType) -> &mut Self { - unsafe { transmute(ffi) } - } -} - /// Helper trait for conversions between FFI Strong/Borrowed types and Arcs /// /// Should be implemented by types which are passed over FFI as Arcs via Strong