mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
35 lines
371 B
Rust
35 lines
371 B
Rust
//@ check-pass
|
|
|
|
fn main() {}
|
|
|
|
macro_rules! mac_impl {
|
|
($i:item) => {
|
|
struct S;
|
|
impl S { $i }
|
|
}
|
|
}
|
|
|
|
mac_impl! {
|
|
fn foo() {}
|
|
}
|
|
|
|
macro_rules! mac_trait {
|
|
($i:item) => {
|
|
trait T { $i }
|
|
}
|
|
}
|
|
|
|
mac_trait! {
|
|
fn foo() {}
|
|
}
|
|
|
|
macro_rules! mac_extern {
|
|
($i:item) => {
|
|
extern "C" { $i }
|
|
}
|
|
}
|
|
|
|
mac_extern! {
|
|
fn foo();
|
|
}
|