Skip to content

Commit 024364a

Browse files
committedJan 30, 2024
Add regression test for #120487
1 parent 75f670d commit 024364a

File tree

1 file changed

+32
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)
Please sign in to comment.