Add regression test for doc cfg applied on public items inside private items
This commit is contained in:
parent
06a6dcd4d2
commit
9119eba24d
1 changed files with 16 additions and 0 deletions
16
tests/rustdoc/doc-auto-cfg-public-in-private.rs
Normal file
16
tests/rustdoc/doc-auto-cfg-public-in-private.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// This test ensures that even though private items are removed from generated docs,
|
||||
// their `cfg`s will still impact their child items.
|
||||
|
||||
#![feature(doc_cfg)]
|
||||
#![crate_name = "foo"]
|
||||
|
||||
pub struct X;
|
||||
|
||||
#[cfg(not(feature = "blob"))]
|
||||
fn foo() {
|
||||
impl X {
|
||||
//@ has 'foo/struct.X.html'
|
||||
//@ has - '//*[@class="stab portability"]' 'Available on non-crate feature blob only.'
|
||||
pub fn bar() {}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue