Add regression test for doc cfg applied on public items inside private items

This commit is contained in:
Guillaume Gomez 2025-09-29 14:31:21 +02:00
parent 06a6dcd4d2
commit 9119eba24d

View 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() {}
}
}