Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 793403a

Browse files
committed
Added test for single_match_else in macro
1 parent ba6a328 commit 793403a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/ui/single_match_else.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,18 @@ fn unwrap_addr() -> Option<&'static ExprNode> {
1818
}
1919
}
2020

21-
fn main() {}
21+
macro_rules! unwrap_addr {
22+
($expression:expr) => {
23+
match $expression {
24+
ExprNode::ExprAddrOf => Some(&NODE),
25+
_ => {
26+
let x = 5;
27+
None
28+
},
29+
}
30+
};
31+
}
32+
33+
fn main() {
34+
unwrap_addr!(ExprNode::Unicorns);
35+
}

0 commit comments

Comments
 (0)