Skip to content

Commit 219195f

Browse files
committed
Add UI test
1 parent cdeb0e3 commit 219195f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/ui/macros/issue-98790.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// run-pass
2+
3+
macro_rules! stringify_item {
4+
($item:item) => {
5+
stringify!($item)
6+
};
7+
}
8+
9+
macro_rules! repro {
10+
($expr:expr) => {
11+
stringify_item! {
12+
pub fn repro() -> bool {
13+
$expr
14+
}
15+
}
16+
};
17+
}
18+
19+
fn main() {
20+
assert_eq!(
21+
repro!(match () { () => true } | true),
22+
"pub fn repro() -> bool { (match () { () => true, }) | true }"
23+
);
24+
}

0 commit comments

Comments
 (0)