diff --git a/cairo/Cargo.toml b/cairo/Cargo.toml index 08d5984a352c..b2be665040b4 100644 --- a/cairo/Cargo.toml +++ b/cairo/Cargo.toml @@ -42,7 +42,7 @@ path = "../glib" [dependencies] ffi = { package = "cairo-sys-rs", path = "sys" } libc = "0.2" -bitflags = "1.0" +bitflags = "2.3" thiserror = "1.0.10" once_cell = "1" freetype-rs = { version = "0.32", optional = true } diff --git a/cairo/src/enums.rs b/cairo/src/enums.rs index 62a18583fa58..65e4d3e12bd0 100644 --- a/cairo/src/enums.rs +++ b/cairo/src/enums.rs @@ -1659,6 +1659,7 @@ gvalue_impl!( ); bitflags::bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct PdfOutline: i32 { #[doc(alias = "PDF_OUTLINE_FLAG_OPEN")] const OPEN = ffi::PDF_OUTLINE_FLAG_OPEN; diff --git a/gdk-pixbuf/Cargo.toml b/gdk-pixbuf/Cargo.toml index d155594c336d..57790a9c1e10 100644 --- a/gdk-pixbuf/Cargo.toml +++ b/gdk-pixbuf/Cargo.toml @@ -29,7 +29,6 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] libc = "0.2" -bitflags = "1.3" ffi = { package = "gdk-pixbuf-sys", path = "sys" } glib = { path = "../glib" } gio = { path = "../gio" } diff --git a/gio/Cargo.toml b/gio/Cargo.toml index 1dbecf4e909e..026950d60b3b 100644 --- a/gio/Cargo.toml +++ b/gio/Cargo.toml @@ -39,7 +39,6 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] libc = "0.2" -bitflags = "1.0" once_cell = "1.0" futures-core = { version = "0.3", default-features = false } futures-channel = "0.3" diff --git a/gio/src/socket_msg_flags.rs b/gio/src/socket_msg_flags.rs index 275ae88d92ba..0973c935c0db 100644 --- a/gio/src/socket_msg_flags.rs +++ b/gio/src/socket_msg_flags.rs @@ -2,10 +2,11 @@ use std::fmt; -use glib::{prelude::*, translate::*, value::FromValue, Type}; +use glib::{bitflags, prelude::*, translate::*, value::FromValue, Type}; bitflags::bitflags! { #[doc(alias = "GSocketMsgFlags")] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct SocketMsgFlags: ffi::GSocketMsgFlags { #[doc(alias = "G_SOCKET_MSG_NONE")] const NONE = ffi::G_SOCKET_MSG_NONE as _; diff --git a/glib-macros/src/flags_attribute.rs b/glib-macros/src/flags_attribute.rs index 40ebf67d24bf..4eea3f961326 100644 --- a/glib-macros/src/flags_attribute.rs +++ b/glib-macros/src/flags_attribute.rs @@ -106,6 +106,7 @@ fn gen_bitflags( quote! { #crate_ident::bitflags::bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #visibility struct #enum_name: u32 { #(#recurse)* } diff --git a/glib/Cargo.toml b/glib/Cargo.toml index 7d340ad5a920..2672b65ea7bf 100644 --- a/glib/Cargo.toml +++ b/glib/Cargo.toml @@ -21,7 +21,7 @@ name = "glib" [dependencies] once_cell = "1.0" libc = "0.2" -bitflags = "1.0" +bitflags = "2.3" futures-core = { version = "0.3", default-features = false } futures-task = { version = "0.3", default-features = false } futures-executor = "0.3" diff --git a/glib/src/gobject/flags.rs b/glib/src/gobject/flags.rs index 7eefa370ad53..c23398b4065a 100644 --- a/glib/src/gobject/flags.rs +++ b/glib/src/gobject/flags.rs @@ -4,6 +4,7 @@ use crate::translate::*; bitflags::bitflags! { #[doc(alias = "GParamFlags")] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct ParamFlags: u32 { #[doc(alias = "G_PARAM_READABLE")] const READABLE = gobject_ffi::G_PARAM_READABLE as _; diff --git a/glib/src/log.rs b/glib/src/log.rs index d80cbfa5c6ef..276d736c9d0f 100644 --- a/glib/src/log.rs +++ b/glib/src/log.rs @@ -103,6 +103,7 @@ impl LogLevel { bitflags::bitflags! { #[doc(alias = "GLogLevelFlags")] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub struct LogLevels: u32 { #[doc(alias = "G_LOG_LEVEL_ERROR")] const LEVEL_ERROR = ffi::G_LOG_LEVEL_ERROR; diff --git a/pango/Cargo.toml b/pango/Cargo.toml index 2efbfeabbc66..ac3cf2592cf8 100644 --- a/pango/Cargo.toml +++ b/pango/Cargo.toml @@ -30,7 +30,6 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] libc = "0.2" -bitflags = "1.0" once_cell = "1.0" ffi = { package = "pango-sys", path = "sys" } glib = { path = "../glib" } diff --git a/pangocairo/Cargo.toml b/pangocairo/Cargo.toml index a8cf222d137f..bf4edbaaf851 100644 --- a/pangocairo/Cargo.toml +++ b/pangocairo/Cargo.toml @@ -22,7 +22,6 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] libc = "0.2" -bitflags = "1.0" ffi = { package = "pangocairo-sys", path = "sys" } glib = { path = "../glib" } pango = { path = "../pango" }