Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. enum E {
  2. A,
  3. B,
  4. C,
  5. D(i32),
  6. }
  7.  
  8. macro_rules! unit_type {
  9. () => (E::A | E::B | E::C)
  10. }
  11.  
  12. fn main() {
  13. match &E::A {
  14. E::D(i) => println!("{}", i),
  15. unit_type!() => println!("unit type"),
  16. // is there a way to let the compiler know there are no more possible matches?
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement