rust/tests/ui/macros/issue-98790.rs
2023-03-02 21:58:57 +01:00

25 lines
419 B
Rust

// 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 }"
);
}