SHARE
TWEET

Untitled

a guest Oct 10th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top