Skip to content

Commit e2d9dee

Browse files
Add regression test for rust-lang#108231
1 parent 24b23aa commit e2d9dee

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/rustdoc/issue-108231.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/108231>.
2+
// Macros with `#[macro_export]` attribute should be visible at the top level
3+
// even if they are inside a doc hidden item.
4+
5+
#![crate_name = "foo"]
6+
7+
// @has 'foo/index.html'
8+
// @count - '//*[@id="main-content"]//a[@class="macro"]' 1
9+
// @has - '//*[@id="main-content"]//a[@class="macro"]' 'foo'
10+
11+
#[doc(hidden)]
12+
pub mod __internal {
13+
/// This one should be visible.
14+
#[macro_export]
15+
macro_rules! foo {
16+
() => {};
17+
}
18+
19+
/// This one should be hidden.
20+
macro_rules! bar {
21+
() => {};
22+
}
23+
}

0 commit comments

Comments
 (0)