17 lines
203 B
Rust
17 lines
203 B
Rust
|
mod m {
|
||
|
pub type t = int;
|
||
|
}
|
||
|
|
||
|
fn macros() {
|
||
|
macro_rules! foo {
|
||
|
($p:path) => {
|
||
|
fn f() -> $p { 10 }
|
||
|
f()
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
assert foo!(m::t) == 10;
|
||
|
}
|