Skip to content

Commit 2ed9454

Browse files
Add test for missing cfg propagation for reexport
1 parent 01d64f5 commit 2ed9454

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/test/rustdoc/cfg_doc_reexport.rs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#![feature(doc_cfg)]
2+
#![feature(no_core)]
3+
4+
#![crate_name = "foo"]
5+
#![no_core]
6+
7+
// @has 'foo/index.html'
8+
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'foobar'
9+
// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'bar'
10+
11+
#[doc(cfg(feature = "foobar"))]
12+
mod imp_priv {
13+
// @has 'foo/struct.BarPriv.html'
14+
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
15+
// 'Available on crate feature foobar only.'
16+
pub struct BarPriv {}
17+
impl BarPriv {
18+
pub fn test() {}
19+
}
20+
}
21+
#[doc(cfg(feature = "foobar"))]
22+
pub use crate::imp_priv::*;
23+
24+
pub mod bar {
25+
// @has 'foo/bar/struct.Bar.html'
26+
// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
27+
// 'Available on crate feature bar only.'
28+
#[doc(cfg(feature = "bar"))]
29+
pub struct Bar;
30+
}
31+
32+
#[doc(cfg(feature = "bar"))]
33+
pub use bar::Bar;

0 commit comments

Comments
 (0)