Skip to content

Commit 9119eba

Browse files
Add regression test for doc cfg applied on public items inside private items
1 parent 06a6dcd commit 9119eba

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This test ensures that even though private items are removed from generated docs,
2+
// their `cfg`s will still impact their child items.
3+
4+
#![feature(doc_cfg)]
5+
#![crate_name = "foo"]
6+
7+
pub struct X;
8+
9+
#[cfg(not(feature = "blob"))]
10+
fn foo() {
11+
impl X {
12+
//@ has 'foo/struct.X.html'
13+
//@ has - '//*[@class="stab portability"]' 'Available on non-crate feature blob only.'
14+
pub fn bar() {}
15+
}
16+
}

0 commit comments

Comments
 (0)