rust: remove useless glib_sys bindings
Subsystems (2)
PATCH 1/1 rust: remove useless glib_sys bindings
From: Martin Kletzander <[email protected]>
The definition of types needed for g_autolist(), g_autoslist(), g_autoqueue() need the imports for GList, GSList and GQueue to appear everything. Rust code is never going to see those, since they are not used in structs. Block the types from appearing in the bindings.
--- meson.build | 1 + rust/bql/src/bindings.rs | 2 +- rust/chardev/src/bindings.rs | 4 ++-- rust/hw/char/pl011/src/bindings.rs | 2 +- rust/hw/core/src/bindings.rs | 2 +- rust/migration/src/bindings.rs | 2 +- rust/qom/src/bindings.rs | 2 +- rust/system/src/bindings.rs | 2 +- rust/util/src/bindings.rs | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-)
meson.build +1 -0
@@ -4255,6 +4255,7 @@ if have_rust '--allowlist-file', meson.project_source_root() + '/include/.*', '--allowlist-file', meson.project_build_root() + '/.*', '--blocklist-file', glib_pc.get_variable('includedir') + '/glib-2.0/.*', + '--blocklist-type', '.*_([a-z]*autoptr)$', ] if not rustfmt.found() if bindgen.version().version_compare('<0.65.0')
rust/bql/src/bindings.rs +1 -1
@@ -19,7 +19,7 @@ )]use glib_sys::{ - guint,GArray ,GHashTable ,GHashTableIter ,GList ,GPollFD ,GPtrArray ,GQueue ,GSList ,GSource , + guint,GArray ,GHashTable ,GHashTableIter ,GPollFD ,GPtrArray ,GSList ,GSource , };#[cfg( MESON )]
rust/chardev/src/bindings.rs +2 -2
@@ -20,8 +20,8 @@use common::Zeroable ;use glib_sys::{ - gboolean, guint,GArray ,GHashTable ,GHashTableIter ,GIOCondition ,GList ,GMainContext , -GPollFD ,GPtrArray ,GQueue ,GSList ,GSource ,GSourceFunc , + gboolean, guint,GArray ,GHashTable ,GHashTableIter ,GIOCondition ,GMainContext , +GPollFD ,GPtrArray ,GSList ,GSource ,GSourceFunc , };#[cfg( MESON )]
rust/hw/char/pl011/src/bindings.rs +1 -1
@@ -22,7 +22,7 @@use glib_sys::{ gboolean, guint,GArray ,GByteArray ,GHashTable ,GHashTableIter ,GIOCondition ,GList , -GMainContext ,GPollFD ,GPtrArray ,GQueue ,GSList ,GSource ,GSourceFunc ,GString , +GMainContext ,GPollFD ,GPtrArray ,GSList ,GSource ,GSourceFunc ,GString , };#[cfg( MESON )]
rust/hw/core/src/bindings.rs +1 -1
@@ -21,7 +21,7 @@use chardev::bindings::Chardev ;use common::Zeroable ;use glib_sys::{ -GArray ,GByteArray ,GHashTable ,GHashTableIter ,GList ,GPtrArray ,GQueue ,GSList ,GString , +GArray ,GByteArray ,GHashTable ,GHashTableIter ,GList ,GPtrArray ,GSList ,GString , };use migration::bindings::VMStateDescription ;use qom::bindings::ObjectClass ;
rust/migration/src/bindings.rs +1 -1
@@ -19,7 +19,7 @@ )]use common::Zeroable ; -use glib_sys::{GHashTable ,GHashTableIter ,GList ,GPtrArray ,GQueue ,GSList }; +use glib_sys::{GHashTable ,GHashTableIter ,GPtrArray ,GSList };#[cfg( MESON )] include! ("bindings.inc.rs" );
rust/qom/src/bindings.rs +1 -1
@@ -18,7 +18,7 @@ clippy::too_many_arguments )] -use glib_sys::{GHashTable ,GHashTableIter ,GList ,GPtrArray ,GQueue ,GSList }; +use glib_sys::{GHashTable ,GHashTableIter ,GPtrArray ,GSList };#[cfg( MESON )] include! ("bindings.inc.rs" );
rust/system/src/bindings.rs +1 -1
@@ -20,7 +20,7 @@use common::Zeroable ;use glib_sys::{ - guint,GArray ,GByteArray ,GHashTable ,GHashTableIter ,GList ,GPollFD ,GPtrArray ,GQueue , + guint,GArray ,GByteArray ,GHashTable ,GHashTableIter ,GList ,GPollFD ,GPtrArray ,GSList ,GString , };
rust/util/src/bindings.rs +1 -1
@@ -18,7 +18,7 @@ clippy::too_many_arguments )] -use glib_sys::{guint,GList ,GPollFD ,GQueue ,GSList ,GString }; +use glib_sys::{guint,GPollFD ,GString };#[cfg( MESON )] include! ("bindings.inc.rs" );
Signature · 1 line
2.51.0
Quoted 16 lines · Paolo Bonzini
Date: Thu, 16 Oct 2025 16:56:19 +0200
From: Paolo Bonzini <[email protected]>
Subject: [PATCH] rust: remove uselessglib_sysbindings
X-Mailer: git-send-email 2.51.0From: Martin Kletzander <[email protected]>
The definition of types needed for
g_autolist(),g_autoslist(),g_autoqueue()need the imports for GList, GSList and GQueue to appear everything. Rust code is never going to see those, since they are not used in structs. Block the types from appearing in the bindings.Co-authored-by Martin Kletzander <[email protected]>Signed-off-by Martin Kletzander <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>
Quoted 11 lines
--- meson.build | 1 + rust/bql/src/bindings.rs | 2 +- rust/chardev/src/bindings.rs | 4 ++-- rust/hw/char/pl011/src/bindings.rs | 2 +- rust/hw/core/src/bindings.rs | 2 +- rust/migration/src/bindings.rs | 2 +- rust/qom/src/bindings.rs | 2 +- rust/system/src/bindings.rs | 2 +- rust/util/src/bindings.rs | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-)