diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-09-29 21:37:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-29 21:37:52 -0400 |
| commit | 745b8f6b746724365c8bb23c0dcec56471c30400 (patch) | |
| tree | f17b1e32da607c0a1d454ba91846b5203ecb7eb3 /tests | |
| parent | afd620f5486c6c0681821f0d54a423482668e343 (diff) | |
| parent | 9119eba24de69902ba421151691d7a294d96fa04 (diff) | |
Rollup merge of #147153 - GuillaumeGomez:doc-propagation-before-stripping-items, r=lolbinarycat
[rustdoc] Move doc cfg propagation pass before items stripping passes Follow-up of https://github.com/rust-lang/rust/pull/138907. r? lolbinarycat
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rustdoc-ui/issues/issue-91713.stdout | 4 | ||||
| -rw-r--r-- | tests/rustdoc/doc-auto-cfg-public-in-private.rs | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/rustdoc-ui/issues/issue-91713.stdout b/tests/rustdoc-ui/issues/issue-91713.stdout index 30aadfe89f4..d34714be6c9 100644 --- a/tests/rustdoc-ui/issues/issue-91713.stdout +++ b/tests/rustdoc-ui/issues/issue-91713.stdout @@ -1,11 +1,11 @@ Available passes for running rustdoc: check-doc-cfg - checks `#[doc(cfg(...))]` for stability feature and unexpected cfgs check_doc_test_visibility - run various visibility-related lints on doctests + propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items strip-aliased-non-local - strips all non-local private aliased items from the output strip-hidden - strips all `#[doc(hidden)]` items from the output strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports strip-priv-imports - strips all private import statements (`use`, `extern crate`) from a crate - propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items propagate-stability - propagates stability to child items collect-intra-doc-links - resolves intra-doc links collect-trait-impls - retrieves trait impls for items in the crate @@ -16,11 +16,11 @@ Default passes for rustdoc: collect-trait-impls check_doc_test_visibility check-doc-cfg +collect-intra-doc-links strip-aliased-non-local strip-hidden (when not --document-hidden-items) strip-private (when not --document-private-items) strip-priv-imports (when --document-private-items) -collect-intra-doc-links propagate-doc-cfg propagate-stability run-lints 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() {} + } +} |
