2021-04-10 21:22:06 +00:00
|
|
|
//@ compile-flags: --document-private-items
|
|
|
|
|
2020-11-27 02:57:11 +00:00
|
|
|
#![feature(decl_macro)]
|
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {'
|
|
|
|
//@ has - //pre '...'
|
|
|
|
//@ has - //pre '}'
|
2020-11-27 02:57:11 +00:00
|
|
|
pub macro my_macro() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {'
|
|
|
|
//@ has - //pre '...'
|
|
|
|
//@ has - //pre '}'
|
2020-11-27 02:57:11 +00:00
|
|
|
pub macro my_macro_2($($tok:tt)*) {
|
|
|
|
|
|
|
|
}
|
2020-11-29 01:46:17 +00:00
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {'
|
|
|
|
//@ has - //pre '(_) => { ... },'
|
|
|
|
//@ has - //pre '($foo:ident . $bar:expr) => { ... },'
|
|
|
|
//@ has - //pre '($($foo:literal),+) => { ... },'
|
|
|
|
//@ has - //pre '}'
|
2020-11-29 01:46:17 +00:00
|
|
|
pub macro my_macro_multi {
|
|
|
|
(_) => {
|
|
|
|
|
|
|
|
},
|
|
|
|
($foo:ident . $bar:expr) => {
|
|
|
|
|
|
|
|
},
|
|
|
|
($($foo:literal),+) => {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2020-11-29 02:32:07 +00:00
|
|
|
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {'
|
|
|
|
//@ has - //pre '...'
|
|
|
|
//@ has - //pre '}'
|
2020-11-29 02:32:07 +00:00
|
|
|
pub macro by_example_single {
|
|
|
|
($foo:expr) => {}
|
|
|
|
}
|
2021-04-10 21:22:06 +00:00
|
|
|
|
|
|
|
mod a {
|
|
|
|
mod b {
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has decl_macro/a/b/macro.by_example_vis.html //pre 'pub(super) macro by_example_vis($foo:expr) {'
|
2021-04-10 21:22:06 +00:00
|
|
|
pub(in super) macro by_example_vis {
|
|
|
|
($foo:expr) => {}
|
|
|
|
}
|
|
|
|
mod c {
|
2024-06-21 12:03:08 +00:00
|
|
|
//@ has decl_macro/a/b/c/macro.by_example_vis_named.html //pre 'pub(in a) macro by_example_vis_named($foo:expr) {'
|
2021-04-10 21:22:06 +00:00
|
|
|
pub(in a) macro by_example_vis_named {
|
|
|
|
($foo:expr) => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|