]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/macros.rs
Fix problem noticed in PR106859 with char -> u8 suggestion
[rust.git] / tests / rustdoc / macros.rs
1 // @has macros/macro.my_macro.html //pre 'macro_rules! my_macro {'
2 // @has - //pre '() => { ... };'
3 // @has - //pre '($a:tt) => { ... };'
4 // @has - //pre '($e:expr) => { ... };'
5 #[macro_export]
6 macro_rules! my_macro {
7     () => [];
8     ($a:tt) => ();
9     ($e:expr) => {};
10 }
11
12 // Check that exported macro defined in a module are shown at crate root.
13 // @has macros/macro.my_sub_macro.html //pre 'macro_rules! my_sub_macro {'
14 // @has - //pre '() => { ... };'
15 // @has - //pre '($a:tt) => { ... };'
16 // @has - //pre '($e:expr) => { ... };'
17 mod sub {
18     #[macro_export]
19     macro_rules! my_sub_macro {
20         () => {};
21         ($a:tt) => {};
22         ($e:expr) => {};
23     }
24 }