Skip to content

Commit

Permalink
Merge pull request #321 from KodrAus/fix/size-int
Browse files Browse the repository at this point in the history
Fix up missing isize and usize Bits impls
  • Loading branch information
KodrAus committed Mar 19, 2023
2 parents 8b43d2b + 94fe8b9 commit ce90a14
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/lib.rs
Expand Up @@ -1548,4 +1548,57 @@ mod tests {

assert_eq!(flags, rebuilt);
}

#[test]
fn bits_types() {
bitflags! {
pub struct I8: i8 {
const A = 1;
}

pub struct I16: i16 {
const A = 1;
}

pub struct I32: i32 {
const A = 1;
}

pub struct I64: i64 {
const A = 1;
}

pub struct I128: i128 {
const A = 1;
}

pub struct Isize: isize {
const A = 1;
}

pub struct U8: u8 {
const A = 1;
}

pub struct U16: u16 {
const A = 1;
}

pub struct U32: u32 {
const A = 1;
}

pub struct U64: u64 {
const A = 1;
}

pub struct U128: u128 {
const A = 1;
}

pub struct Usize: usize {
const A = 1;
}
}
}
}
1 change: 1 addition & 0 deletions src/traits.rs
Expand Up @@ -138,6 +138,7 @@ impl_bits! {
u32, i32,
u64, i64,
u128, i128,
usize, isize,
}

/// A trait for referencing the `bitflags`-owned internal type
Expand Down

0 comments on commit ce90a14

Please sign in to comment.