Skip to content

Commit

Permalink
Merge pull request #266 from konsumlamm/sanitize
Browse files Browse the repository at this point in the history
Sanitize `Ok`
  • Loading branch information
KodrAus committed Jan 8, 2022
2 parents 1aa25e1 + 057ea95 commit 54b1b86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -500,7 +500,7 @@ macro_rules! __impl_bitflags {
if first {
f.write_str("(empty)")?;
}
Ok(())
$crate::_core::fmt::Result::Ok(())
}
}
impl $crate::_core::fmt::Binary for $BitFlags {
Expand Down
15 changes: 15 additions & 0 deletions tests/compile-pass/redefinition/result.rs
@@ -0,0 +1,15 @@
use bitflags::bitflags;

// Checks for possible errors caused by overriding names used by `bitflags!` internally.

// bug #265 (https://github.com/bitflags/bitflags/issues/265)

pub struct Ok<T>(T);

bitflags! {
pub struct Flags: u16{
const FOO = 0x0001;
}
}

fn main() {}

0 comments on commit 54b1b86

Please sign in to comment.