Skip to content

Commit

Permalink
Added test for single_match_else in macro
Browse files Browse the repository at this point in the history
  • Loading branch information
pmk21 committed Mar 31, 2020
1 parent ba6a328 commit 793403a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/ui/single_match_else.rs
Expand Up @@ -18,4 +18,18 @@ fn unwrap_addr() -> Option<&'static ExprNode> {
}
}

fn main() {}
macro_rules! unwrap_addr {
($expression:expr) => {
match $expression {
ExprNode::ExprAddrOf => Some(&NODE),
_ => {
let x = 5;
None
},
}
};
}

fn main() {
unwrap_addr!(ExprNode::Unicorns);
}

0 comments on commit 793403a

Please sign in to comment.