summaryrefslogtreecommitdiffstats
path: root/tests/ui/macros/issue-98790.rs
blob: 8fe6fc41d10b77435e0e39bb330d9de117bc7f13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// run-pass

macro_rules! stringify_item {
    ($item:item) => {
        stringify!($item)
    };
}

macro_rules! repro {
    ($expr:expr) => {
        stringify_item! {
            pub fn repro() -> bool {
                $expr
            }
        }
    };
}

fn main() {
    assert_eq!(
        repro!(match () { () => true } | true),
        "pub fn repro() -> bool { (match () { () => true, }) | true }"
    );
}