rust/tests/rustdoc/macros.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
671 B
Rust
Raw Normal View History

// @has macros/macro.my_macro.html //pre 'macro_rules! my_macro {'
2015-11-28 07:47:12 -06:00
// @has - //pre '() => { ... };'
// @has - //pre '($a:tt) => { ... };'
// @has - //pre '($e:expr) => { ... };'
2015-11-28 07:47:12 -06:00
#[macro_export]
macro_rules! my_macro {
() => [];
($a:tt) => ();
($e:expr) => {};
}
2020-12-28 15:01:05 -06:00
// 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) => { ... };'
2020-12-28 15:01:05 -06:00
mod sub {
#[macro_export]
macro_rules! my_sub_macro {
() => {};
($a:tt) => {};
($e:expr) => {};
}
}