diff --git a/src/test/rustdoc/macros.rs b/src/test/rustdoc/macros.rs index fb4f02ad16052..ae0cf7a14789d 100644 --- a/src/test/rustdoc/macros.rs +++ b/src/test/rustdoc/macros.rs @@ -8,3 +8,17 @@ 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) => {}; + } +}