stringify.rs 390 B

12345678910111213141516171819
  1. use bitflags::bitflags;
  2. // Checks for possible errors caused by overriding names used by `bitflags!` internally.
  3. #[allow(unused_macros)]
  4. macro_rules! stringify {
  5. ($($t:tt)*) => { "..." };
  6. }
  7. bitflags! {
  8. struct Test: u8 {
  9. const A = 1;
  10. }
  11. }
  12. fn main() {
  13. // Just make sure we don't call the redefined `stringify` macro
  14. assert_eq!(format!("{:?}", Test::A), "A");
  15. }