mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
25 lines
671 B
Rust
25 lines
671 B
Rust
//@ has macros/macro.my_macro.html //pre 'macro_rules! my_macro {'
|
|
//@ has - //pre '() => { ... };'
|
|
//@ has - //pre '($a:tt) => { ... };'
|
|
//@ has - //pre '($e:expr) => { ... };'
|
|
#[macro_export]
|
|
macro_rules! my_macro {
|
|
() => [];
|
|
($a:tt) => ();
|
|
($e:expr) => {};
|
|
}
|
|
|
|
// Check that exported macro defined in a module are shown at crate root.
|
|
//@ has macros/macro.my_sub_macro.html //pre 'macro_rules! my_sub_macro {'
|
|
//@ has - //pre '() => { ... };'
|
|
//@ has - //pre '($a:tt) => { ... };'
|
|
//@ has - //pre '($e:expr) => { ... };'
|
|
mod sub {
|
|
#[macro_export]
|
|
macro_rules! my_sub_macro {
|
|
() => {};
|
|
($a:tt) => {};
|
|
($e:expr) => {};
|
|
}
|
|
}
|