File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,11 @@ pub(crate) enum Condition {
7777pub ( crate ) const PASSES : & [ Pass ] = & [
7878 CHECK_DOC_CFG ,
7979 CHECK_DOC_TEST_VISIBILITY ,
80+ PROPAGATE_DOC_CFG ,
8081 STRIP_ALIASED_NON_LOCAL ,
8182 STRIP_HIDDEN ,
8283 STRIP_PRIVATE ,
8384 STRIP_PRIV_IMPORTS ,
84- PROPAGATE_DOC_CFG ,
8585 PROPAGATE_STABILITY ,
8686 COLLECT_INTRA_DOC_LINKS ,
8787 COLLECT_TRAIT_IMPLS ,
@@ -94,11 +94,11 @@ pub(crate) const DEFAULT_PASSES: &[ConditionalPass] = &[
9494 ConditionalPass :: always ( COLLECT_TRAIT_IMPLS ) ,
9595 ConditionalPass :: always ( CHECK_DOC_TEST_VISIBILITY ) ,
9696 ConditionalPass :: always ( CHECK_DOC_CFG ) ,
97+ ConditionalPass :: always ( COLLECT_INTRA_DOC_LINKS ) ,
9798 ConditionalPass :: always ( STRIP_ALIASED_NON_LOCAL ) ,
9899 ConditionalPass :: new ( STRIP_HIDDEN , WhenNotDocumentHidden ) ,
99100 ConditionalPass :: new ( STRIP_PRIVATE , WhenNotDocumentPrivate ) ,
100101 ConditionalPass :: new ( STRIP_PRIV_IMPORTS , WhenDocumentPrivate ) ,
101- ConditionalPass :: always ( COLLECT_INTRA_DOC_LINKS ) ,
102102 ConditionalPass :: always ( PROPAGATE_DOC_CFG ) ,
103103 ConditionalPass :: always ( PROPAGATE_STABILITY ) ,
104104 ConditionalPass :: always ( RUN_LINTS ) ,
Original file line number Diff line number Diff line change 11Available passes for running rustdoc:
22 check-doc-cfg - checks `#[doc(cfg(...))]` for stability feature and unexpected cfgs
33check_doc_test_visibility - run various visibility-related lints on doctests
4+ propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
45strip-aliased-non-local - strips all non-local private aliased items from the output
56 strip-hidden - strips all `#[doc(hidden)]` items from the output
67 strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports
78 strip-priv-imports - strips all private import statements (`use`, `extern crate`) from a crate
8- propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
99 propagate-stability - propagates stability to child items
1010collect-intra-doc-links - resolves intra-doc links
1111 collect-trait-impls - retrieves trait impls for items in the crate
@@ -16,11 +16,11 @@ Default passes for rustdoc:
1616 collect-trait-impls
1717check_doc_test_visibility
1818 check-doc-cfg
19+ collect-intra-doc-links
1920strip-aliased-non-local
2021 strip-hidden (when not --document-hidden-items)
2122 strip-private (when not --document-private-items)
2223 strip-priv-imports (when --document-private-items)
23- collect-intra-doc-links
2424 propagate-doc-cfg
2525 propagate-stability
2626 run-lints
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments