Skip to content

Commit 1ec1d94

Browse files
Add test for reexports attr merge
1 parent 02a845a commit 1ec1d94

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/rustdoc/reexport-attr-merge.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/59368>.
2+
// The goal is to ensure that `doc(hidden)`, `doc(inline)` and `doc(no_inline`)
3+
4+
#![crate_name = "foo"]
5+
#![feature(doc_cfg)]
6+
7+
// @has 'foo/index.html'
8+
9+
#[doc(hidden, cfg(feature = "foo"))]
10+
pub struct Foo;
11+
12+
#[doc(hidden, no_inline, cfg(feature = "bar"))]
13+
pub use Foo as Foo1;
14+
15+
#[doc(hidden, inline)]
16+
pub use Foo1 as Foo2;
17+
18+
// First we ensure that none of the other items are generated.
19+
// @count - '//a[@class="struct"]' 1
20+
// Then we check that both `cfg` are displayed.
21+
// @has - '//*[@class="stab portability"]' 'foo'
22+
// @has - '//*[@class="stab portability"]' 'bar'
23+
// And finally we check that the only element displayed is `Bar`.
24+
// @has - '//a[@class="struct"]' 'Bar'
25+
#[doc(inline)]
26+
pub use Foo2 as Bar;

0 commit comments

Comments
 (0)