Skip to content

Commit 295fd0d

Browse files
Add regression test for reexported macros docs
1 parent ddb31de commit 295fd0d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/rustdoc/reexport-macro.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Ensure that macros are correctly reexported and that they get both the comment from the
2+
// `pub use` and from the macro.
3+
4+
#![crate_name = "foo"]
5+
6+
// @has 'foo/macro.foo.html'
7+
// @!has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y'
8+
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'y'
9+
#[macro_use]
10+
mod my_module {
11+
/// y
12+
#[macro_export]
13+
macro_rules! foo {
14+
() => ();
15+
}
16+
}
17+
18+
// @has 'foo/another_mod/macro.bar.html'
19+
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y'
20+
pub mod another_mod {
21+
/// x
22+
pub use crate::foo as bar;
23+
}

0 commit comments

Comments
 (0)