diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-09-29 14:31:21 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-09-29 18:08:51 +0200 |
| commit | 9119eba24de69902ba421151691d7a294d96fa04 (patch) | |
| tree | 3743a585d71f56b9fabfbf0015464a9d80d8f15b /tests/rustdoc | |
| parent | 06a6dcd4d276826a7600302c08a0d448e23c1d33 (diff) | |
| download | rust-9119eba24de69902ba421151691d7a294d96fa04.tar.gz rust-9119eba24de69902ba421151691d7a294d96fa04.zip | |
Add regression test for doc cfg applied on public items inside private items
Diffstat (limited to 'tests/rustdoc')
| -rw-r--r-- | tests/rustdoc/doc-auto-cfg-public-in-private.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/rustdoc/doc-auto-cfg-public-in-private.rs b/tests/rustdoc/doc-auto-cfg-public-in-private.rs new file mode 100644 index 00000000000..b78e3f1b932 --- /dev/null +++ b/tests/rustdoc/doc-auto-cfg-public-in-private.rs @@ -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() {} + } +} |
