rust/src/test/run-pass/macros/issue-25274.rs
2019-07-27 18:56:13 +03:00

19 lines
266 B
Rust

// run-pass
macro_rules! test {
(
fn fun() -> Option<Box<$t:ty>>;
) => {
fn fun(x: $t) -> Option<Box<$t>>
{ Some(Box::new(x)) }
}
}
test! {
fn fun() -> Option<Box<i32>>;
}
fn main() {
println!("{}", fun(0).unwrap());
}