Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum E {
- A,
- B,
- C,
- D(i32),
- }
- macro_rules! unit_type {
- () => (E::A | E::B | E::C)
- }
- fn main() {
- match &E::A {
- E::D(i) => println!("{}", i),
- unit_type!() => println!("unit type"),
- // is there a way to let the compiler know there are no more possible matches?
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement