2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2023-02-28 06:05:45 +01:00
|
|
|
|
|
|
|
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 }"
|
|
|
|
);
|
|
|
|
}
|