From nobody Sat Nov 23 21:47:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1730741537; cv=none; d=zohomail.com; s=zohoarc; b=SKpXlTBxQlVJzhUo2Zeddr1RbME8FBaNHjXf6JyUok8PCk4KcYr93mxjP8JAqUtztHGWii+8EbXXsMchAUlY/kztMb/KgGHgyWsT/l50QhoEHztk6nyk5G4O4fMxsq/5zeZ410dHp0a/C5gzzUrEXDHQiKjv9gloLtMRbOBRThY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730741537; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oeACifbCFLCHko0mFSBbcv0dEN3Keg1lZLZXzqzwC4Y=; b=GYvB7UaduZUgisR5BsSaMUY3p4o9c+gveQHmgVoGssIJDeLzFUkB7LAIbeWqCwt8y0IQatK2Z4fKlGl5ysKNbMOPi4pwgPiDaZw53v3IxiS25tivJNH1imREC34WB09IP0YnZRyWknuzyvnmWVla2PD1N317w6B3LlD4z3r4p98= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730741537172723.800861112066; Mon, 4 Nov 2024 09:32:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t80sU-000633-Bt; Mon, 04 Nov 2024 12:28:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t80sS-0005ru-Bi for qemu-devel@nongnu.org; Mon, 04 Nov 2024 12:28:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t80sN-0000Nx-4h for qemu-devel@nongnu.org; Mon, 04 Nov 2024 12:28:31 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-eg-Pve9dPA28lkgodWEgKQ-1; Mon, 04 Nov 2024 12:28:24 -0500 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-431518e6d8fso29102445e9.0 for ; Mon, 04 Nov 2024 09:28:24 -0800 (PST) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d698144sm164522305e9.39.2024.11.04.09.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2024 09:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730741305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oeACifbCFLCHko0mFSBbcv0dEN3Keg1lZLZXzqzwC4Y=; b=ADrErDDNyJrPdvO0E/OXEZuzGY2qAzE+4rXKuFLq/Q4QyMhJsOUmRXK7qYQCRmZ1rit5s2 7zHZ/Icsa1165wt9ChrUqJ5gepWEiz4/ilxhYDVtfoAdr+sIkf9RMGsX6BNde1gN7uQ0OH K/7VfzPXyh45rHuk9mLR7WK8L1zSvwM= X-MC-Unique: eg-Pve9dPA28lkgodWEgKQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730741302; x=1731346102; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oeACifbCFLCHko0mFSBbcv0dEN3Keg1lZLZXzqzwC4Y=; b=mIDcEpTrTE+Weh2FGV/+titGkfmsZzXCGmxHuNB1cPpiPbYwm/KiWbN5M++00uqwDY 3xOx6CwjttSdO1dNpJmaAPAGgZOkyETRQKcrFkqot7cTKhaq7PNJ0FxzsmFY5mpQSbO/ v4m3d642P1o/ifWGTu9HUJS1d6RaeaDTB9bICy9mzJfOXCE8fHB/C2JeF0UD2GM4Fs0w 3DjUP5eBnZdauaUVRjQvomJ0uewjqruW+BpotzauL9DDrW26tFyf4fcl88wbE+eteFMS LguNAWuaamLcoYUuZMoPZb4jmzZhswHPih1VfAB2bUc6DgwUf2L1QNgc6Qk6q7v14rnq FIkA== X-Gm-Message-State: AOJu0YwyAkxzjA8KUJ1BvKJsHKbxNbNFvIrAil1OOEl/kIxNxTwnOvAJ Z9su8jsDbtf8X7n0qpwmQZH9muiRxpdOttjqdyS+GsIvRgwtj/iZ61Fc3b06XR5eOIWp6USWagK isLMHoiSi+E+X2asZk9Qua+XUCh7EH0vLnTlHGof0bKddhSf/CgtipoDNMoNCSm5kKboqeIznr8 /9R8Wo4AxYjn4a0bhW6Y2GjPFdjCC6KzMToEMNzGc= X-Received: by 2002:a05:600c:3b83:b0:431:5ba1:a513 with SMTP id 5b1f17b1804b1-43283244db4mr104214475e9.10.1730741302139; Mon, 04 Nov 2024 09:28:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8tN8ySatGtD1LXrRTQod/wYVFKxtqYOVj3mcgD18rn9nxfate/Q+JAT4K8H14libNs7yjkw== X-Received: by 2002:a05:600c:3b83:b0:431:5ba1:a513 with SMTP id 5b1f17b1804b1-43283244db4mr104214065e9.10.1730741301616; Mon, 04 Nov 2024 09:28:21 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Junjie Mao , Kevin Wolf , Manos Pitsidianakis , Pierrick Bouvier , Zhao Liu Subject: [PULL 27/40] rust: use std::os::raw instead of core::ffi Date: Mon, 4 Nov 2024 18:27:06 +0100 Message-ID: <20241104172721.180255-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104172721.180255-1-pbonzini@redhat.com> References: <20241104172721.180255-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.34, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1730741538284116600 Content-Type: text/plain; charset="utf-8" core::ffi::c_* types were introduced in Rust 1.64.0. Use the older types in std::os::raw, which are now aliases of the types in core::ffi. There is no need to compile QEMU as no_std, so this is acceptable as long as we supp= ort a version of Debian with Rust 1.63.0. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- meson.build | 3 +-- rust/hw/char/pl011/src/device.rs | 35 +++++++++++----------------- rust/hw/char/pl011/src/lib.rs | 4 ++-- rust/hw/char/pl011/src/memory_ops.rs | 14 +++-------- rust/qemu-api/src/definitions.rs | 2 +- rust/qemu-api/src/device_class.rs | 6 ++--- rust/qemu-api/src/lib.rs | 11 +++++---- rust/qemu-api/src/vmstate.rs | 10 ++++---- rust/qemu-api/tests/tests.rs | 9 ++++--- 9 files changed, 39 insertions(+), 55 deletions(-) diff --git a/meson.build b/meson.build index d360120b233..aa0b0fc5584 100644 --- a/meson.build +++ b/meson.build @@ -3947,14 +3947,13 @@ if have_rust and have_system bindgen_args =3D [ '--disable-header-comment', '--raw-line', '// @generated', - '--ctypes-prefix', 'core::ffi', + '--ctypes-prefix', 'std::os::raw', '--formatter', 'rustfmt', '--generate-block', '--generate-cstr', '--impl-debug', '--merge-extern-blocks', '--no-doc-comments', - '--use-core', '--with-derive-default', '--no-layout-tests', '--no-prepend-enum-name', diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/devi= ce.rs index 788b47203b1..036757f7f3a 100644 --- a/rust/hw/char/pl011/src/device.rs +++ b/rust/hw/char/pl011/src/device.rs @@ -2,9 +2,10 @@ // Author(s): Manos Pitsidianakis // SPDX-License-Identifier: GPL-2.0-or-later =20 -use core::{ - ffi::{c_int, c_uchar, c_uint, c_void, CStr}, - ptr::{addr_of, addr_of_mut, NonNull}, +use core::ptr::{addr_of, addr_of_mut, NonNull}; +use std::{ + ffi::CStr, + os::raw::{c_int, c_uchar, c_uint, c_void}, }; =20 use qemu_api::{ @@ -117,11 +118,10 @@ pub struct PL011Class { } =20 impl qemu_api::definitions::Class for PL011Class { - const CLASS_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut core::ffi= ::c_void), - > =3D Some(crate::device_class::pl011_class_init); + const CLASS_INIT: Option =3D + Some(crate::device_class::pl011_class_init); const CLASS_BASE_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut core::ffi= ::c_void), + unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut c_void), > =3D None; } =20 @@ -176,11 +176,7 @@ unsafe fn init(&mut self) { } } =20 - pub fn read( - &mut self, - offset: hwaddr, - _size: core::ffi::c_uint, - ) -> std::ops::ControlFlow { + pub fn read(&mut self, offset: hwaddr, _size: c_uint) -> std::ops::Con= trolFlow { use RegisterOffset::*; =20 std::ops::ControlFlow::Break(match RegisterOffset::try_from(offset= ) { @@ -562,11 +558,7 @@ pub fn post_load(&mut self, _version_id: u32) -> Resul= t<(), ()> { /// readable/writeable from one thread at any time. /// /// The buffer and size arguments must also be valid. -pub unsafe extern "C" fn pl011_receive( - opaque: *mut core::ffi::c_void, - buf: *const u8, - size: core::ffi::c_int, -) { +pub unsafe extern "C" fn pl011_receive(opaque: *mut c_void, buf: *const u8= , size: c_int) { unsafe { debug_assert!(!opaque.is_null()); let mut state =3D NonNull::new_unchecked(opaque.cast::= ()); @@ -585,7 +577,7 @@ pub fn post_load(&mut self, _version_id: u32) -> Result= <(), ()> { /// We expect the FFI user of this function to pass a valid pointer, that = has /// the same size as [`PL011State`]. We also expect the device is /// readable/writeable from one thread at any time. -pub unsafe extern "C" fn pl011_event(opaque: *mut core::ffi::c_void, event= : QEMUChrEvent) { +pub unsafe extern "C" fn pl011_event(opaque: *mut c_void, event: QEMUChrEv= ent) { unsafe { debug_assert!(!opaque.is_null()); let mut state =3D NonNull::new_unchecked(opaque.cast::= ()); @@ -656,11 +648,10 @@ pub struct PL011LuminaryClass { } =20 impl qemu_api::definitions::Class for PL011LuminaryClass { - const CLASS_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut core::ffi= ::c_void), - > =3D None; + const CLASS_INIT: Option =3D + None; const CLASS_BASE_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut core::ffi= ::c_void), + unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut c_void), > =3D None; } =20 diff --git a/rust/hw/char/pl011/src/lib.rs b/rust/hw/char/pl011/src/lib.rs index fb33110d3d8..69e96d72854 100644 --- a/rust/hw/char/pl011/src/lib.rs +++ b/rust/hw/char/pl011/src/lib.rs @@ -46,8 +46,8 @@ pub mod device_class; pub mod memory_ops; =20 -pub const TYPE_PL011: &::core::ffi::CStr =3D c"pl011"; -pub const TYPE_PL011_LUMINARY: &::core::ffi::CStr =3D c"pl011_luminary"; +pub const TYPE_PL011: &::std::ffi::CStr =3D c"pl011"; +pub const TYPE_PL011_LUMINARY: &::std::ffi::CStr =3D c"pl011_luminary"; =20 /// Offset of each register from the base memory address of the device. /// diff --git a/rust/hw/char/pl011/src/memory_ops.rs b/rust/hw/char/pl011/src/= memory_ops.rs index fc69922fbf3..169d485a4d2 100644 --- a/rust/hw/char/pl011/src/memory_ops.rs +++ b/rust/hw/char/pl011/src/memory_ops.rs @@ -3,6 +3,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later =20 use core::ptr::NonNull; +use std::os::raw::{c_uint, c_void}; =20 use qemu_api::{bindings::*, zeroable::Zeroable}; =20 @@ -22,11 +23,7 @@ }, }; =20 -unsafe extern "C" fn pl011_read( - opaque: *mut core::ffi::c_void, - addr: hwaddr, - size: core::ffi::c_uint, -) -> u64 { +unsafe extern "C" fn pl011_read(opaque: *mut c_void, addr: hwaddr, size: c= _uint) -> u64 { assert!(!opaque.is_null()); let mut state =3D unsafe { NonNull::new_unchecked(opaque.cast::()) }; let val =3D unsafe { state.as_mut().read(addr, size) }; @@ -43,12 +40,7 @@ } } =20 -unsafe extern "C" fn pl011_write( - opaque: *mut core::ffi::c_void, - addr: hwaddr, - data: u64, - _size: core::ffi::c_uint, -) { +unsafe extern "C" fn pl011_write(opaque: *mut c_void, addr: hwaddr, data: = u64, _size: c_uint) { unsafe { assert!(!opaque.is_null()); let mut state =3D NonNull::new_unchecked(opaque.cast::= ()); diff --git a/rust/qemu-api/src/definitions.rs b/rust/qemu-api/src/definitio= ns.rs index 064afe60549..26597934bbd 100644 --- a/rust/qemu-api/src/definitions.rs +++ b/rust/qemu-api/src/definitions.rs @@ -4,7 +4,7 @@ =20 //! Definitions required by QEMU when registering a device. =20 -use ::core::ffi::{c_void, CStr}; +use std::{ffi::CStr, os::raw::c_void}; =20 use crate::bindings::{Object, ObjectClass, TypeInfo}; =20 diff --git a/rust/qemu-api/src/device_class.rs b/rust/qemu-api/src/device_c= lass.rs index 3d40256f60f..cb4573ca6ef 100644 --- a/rust/qemu-api/src/device_class.rs +++ b/rust/qemu-api/src/device_class.rs @@ -7,7 +7,7 @@ macro_rules! device_class_init { ($func:ident, props =3D> $props:ident, realize_fn =3D> $realize_fn:exp= r, legacy_reset_fn =3D> $legacy_reset_fn:expr, vmsd =3D> $vmsd:ident$(,)*) = =3D> { pub unsafe extern "C" fn $func( klass: *mut $crate::bindings::ObjectClass, - _: *mut ::core::ffi::c_void, + _: *mut ::std::os::raw::c_void, ) { let mut dc =3D ::core::ptr::NonNull::new(klass.cast::<$crate::bindings::D= eviceClass>()).unwrap(); @@ -26,7 +26,7 @@ macro_rules! define_property { ($name:expr, $state:ty, $field:expr, $prop:expr, $type:expr, default = =3D $defval:expr$(,)*) =3D> { $crate::bindings::Property { // use associated function syntax for type checking - name: ::core::ffi::CStr::as_ptr($name), + name: ::std::ffi::CStr::as_ptr($name), info: $prop, offset: ::core::mem::offset_of!($state, $field) as isize, set_default: true, @@ -37,7 +37,7 @@ macro_rules! define_property { ($name:expr, $state:ty, $field:expr, $prop:expr, $type:expr$(,)*) =3D>= { $crate::bindings::Property { // use associated function syntax for type checking - name: ::core::ffi::CStr::as_ptr($name), + name: ::std::ffi::CStr::as_ptr($name), info: $prop, offset: ::core::mem::offset_of!($state, $field) as isize, set_default: false, diff --git a/rust/qemu-api/src/lib.rs b/rust/qemu-api/src/lib.rs index 10ab3d7e639..ed840ee2f72 100644 --- a/rust/qemu-api/src/lib.rs +++ b/rust/qemu-api/src/lib.rs @@ -34,7 +34,10 @@ unsafe impl Sync for bindings::VMStateInfo {} pub mod vmstate; pub mod zeroable; =20 -use std::alloc::{GlobalAlloc, Layout}; +use std::{ + alloc::{GlobalAlloc, Layout}, + os::raw::c_void, +}; =20 #[cfg(HAVE_GLIB_WITH_ALIGNED_ALLOC)] extern "C" { @@ -48,8 +51,8 @@ fn g_aligned_alloc0( =20 #[cfg(not(HAVE_GLIB_WITH_ALIGNED_ALLOC))] extern "C" { - fn qemu_memalign(alignment: usize, size: usize) -> *mut ::core::ffi::c= _void; - fn qemu_vfree(ptr: *mut ::core::ffi::c_void); + fn qemu_memalign(alignment: usize, size: usize) -> *mut c_void; + fn qemu_vfree(ptr: *mut c_void); } =20 extern "C" { @@ -114,7 +117,7 @@ fn default() -> Self { } =20 // Sanity check. -const _: [(); 8] =3D [(); ::core::mem::size_of::<*mut ::core::ffi::c_void>= ()]; +const _: [(); 8] =3D [(); ::core::mem::size_of::<*mut c_void>()]; =20 unsafe impl GlobalAlloc for QemuAllocator { unsafe fn alloc(&self, layout: Layout) -> *mut u8 { diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs index 0c1197277f9..4e06e40505f 100644 --- a/rust/qemu-api/src/vmstate.rs +++ b/rust/qemu-api/src/vmstate.rs @@ -56,7 +56,7 @@ macro_rules! vmstate_single_test { $crate::bindings::VMStateField { name: ::core::concat!(::core::stringify!($field_name), 0) .as_bytes() - .as_ptr() as *const ::core::ffi::c_char, + .as_ptr() as *const ::std::os::raw::c_char, err_hint: ::core::ptr::null(), offset: ::core::mem::offset_of!($struct_name, $field_name), size: $size, @@ -133,7 +133,7 @@ macro_rules! vmstate_array { $crate::bindings::VMStateField { name: ::core::concat!(::core::stringify!($field_name), 0) .as_bytes() - .as_ptr() as *const ::core::ffi::c_char, + .as_ptr() as *const ::std::os::raw::c_char, err_hint: ::core::ptr::null(), offset: ::core::mem::offset_of!($struct_name, $field_name), size: $size, @@ -181,7 +181,7 @@ macro_rules! vmstate_struct_pointer_v { $crate::bindings::VMStateField { name: ::core::concat!(::core::stringify!($field_name), 0) .as_bytes() - .as_ptr() as *const ::core::ffi::c_char, + .as_ptr() as *const ::std::os::raw::c_char, err_hint: ::core::ptr::null(), offset: ::core::mem::offset_of!($struct_name, $field_name), size: ::core::mem::size_of::<*const $type>(), @@ -206,7 +206,7 @@ macro_rules! vmstate_array_of_pointer { $crate::bindings::VMStateField { name: ::core::concat!(::core::stringify!($field_name), 0) .as_bytes() - .as_ptr() as *const ::core::ffi::c_char, + .as_ptr() as *const ::std::os::raw::c_char, version_id: $version_id, num: $num as _, info: unsafe { $info }, @@ -231,7 +231,7 @@ macro_rules! vmstate_array_of_pointer_to_struct { $crate::bindings::VMStateField { name: ::core::concat!(::core::stringify!($field_name), 0) .as_bytes() - .as_ptr() as *const ::core::ffi::c_char, + .as_ptr() as *const ::std::os::raw::c_char, version_id: $version_id, num: $num as _, vmsd: unsafe { $vmsd }, diff --git a/rust/qemu-api/tests/tests.rs b/rust/qemu-api/tests/tests.rs index 37c4dd44f81..c7089f0cf21 100644 --- a/rust/qemu-api/tests/tests.rs +++ b/rust/qemu-api/tests/tests.rs @@ -2,7 +2,7 @@ // Author(s): Manos Pitsidianakis // SPDX-License-Identifier: GPL-2.0-or-later =20 -use core::ffi::CStr; +use std::{ffi::CStr, os::raw::c_void}; =20 use qemu_api::{ bindings::*, @@ -64,11 +64,10 @@ impl ObjectImpl for DummyState { } =20 impl Class for DummyClass { - const CLASS_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut core:= :ffi::c_void), - > =3D Some(dummy_class_init); + const CLASS_INIT: Option =3D + Some(dummy_class_init); const CLASS_BASE_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut core:= :ffi::c_void), + unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut c_voi= d), > =3D None; } =20 --=20 2.47.0