Skip to content

Commit 48c4272

Browse files
Add regression test for doc_auto_cfg feature handling with glob reexports
1 parent ea4a36b commit 48c4272

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// This test ensures that non-glob reexports don't get their attributes merge with
2+
// the reexported item whereas glob reexports do with the `doc_auto_cfg` feature.
3+
4+
#![crate_name = "foo"]
5+
#![feature(doc_auto_cfg)]
6+
7+
// @has 'foo/index.html'
8+
// There are two items.
9+
// @count - '//*[@class="item-table"]//div[@class="item-name"]' 2
10+
// Only one of them should have an attribute.
11+
// @count - '//*[@class="item-table"]//div[@class="item-name"]/*[@class="stab portability"]' 1
12+
13+
mod a {
14+
#[cfg(not(feature = "a"))]
15+
pub struct Test1;
16+
}
17+
18+
mod b {
19+
#[cfg(not(feature = "a"))]
20+
pub struct Test2;
21+
}
22+
23+
// @has 'foo/struct.Test1.html'
24+
// @count - '//*[@id="main-content"]/*[@class="item-info"]' 1
25+
// @has - '//*[@id="main-content"]/*[@class="item-info"]' 'Available on non-crate feature a only.'
26+
pub use a::*;
27+
// @has 'foo/struct.Test2.html'
28+
// @count - '//*[@id="main-content"]/*[@class="item-info"]' 0
29+
pub use b::Test2;

0 commit comments

Comments
 (0)