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 {
77
77
pub ( crate ) const PASSES : & [ Pass ] = & [
78
78
CHECK_DOC_CFG ,
79
79
CHECK_DOC_TEST_VISIBILITY ,
80
+ PROPAGATE_DOC_CFG ,
80
81
STRIP_ALIASED_NON_LOCAL ,
81
82
STRIP_HIDDEN ,
82
83
STRIP_PRIVATE ,
83
84
STRIP_PRIV_IMPORTS ,
84
- PROPAGATE_DOC_CFG ,
85
85
PROPAGATE_STABILITY ,
86
86
COLLECT_INTRA_DOC_LINKS ,
87
87
COLLECT_TRAIT_IMPLS ,
@@ -94,11 +94,11 @@ pub(crate) const DEFAULT_PASSES: &[ConditionalPass] = &[
94
94
ConditionalPass :: always ( COLLECT_TRAIT_IMPLS ) ,
95
95
ConditionalPass :: always ( CHECK_DOC_TEST_VISIBILITY ) ,
96
96
ConditionalPass :: always ( CHECK_DOC_CFG ) ,
97
+ ConditionalPass :: always ( COLLECT_INTRA_DOC_LINKS ) ,
97
98
ConditionalPass :: always ( STRIP_ALIASED_NON_LOCAL ) ,
98
99
ConditionalPass :: new ( STRIP_HIDDEN , WhenNotDocumentHidden ) ,
99
100
ConditionalPass :: new ( STRIP_PRIVATE , WhenNotDocumentPrivate ) ,
100
101
ConditionalPass :: new ( STRIP_PRIV_IMPORTS , WhenDocumentPrivate ) ,
101
- ConditionalPass :: always ( COLLECT_INTRA_DOC_LINKS ) ,
102
102
ConditionalPass :: always ( PROPAGATE_DOC_CFG ) ,
103
103
ConditionalPass :: always ( PROPAGATE_STABILITY ) ,
104
104
ConditionalPass :: always ( RUN_LINTS ) ,
Original file line number Diff line number Diff line change 1
1
Available passes for running rustdoc:
2
2
check-doc-cfg - checks `#[doc(cfg(...))]` for stability feature and unexpected cfgs
3
3
check_doc_test_visibility - run various visibility-related lints on doctests
4
+ propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
4
5
strip-aliased-non-local - strips all non-local private aliased items from the output
5
6
strip-hidden - strips all `#[doc(hidden)]` items from the output
6
7
strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports
7
8
strip-priv-imports - strips all private import statements (`use`, `extern crate`) from a crate
8
- propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
9
9
propagate-stability - propagates stability to child items
10
10
collect-intra-doc-links - resolves intra-doc links
11
11
collect-trait-impls - retrieves trait impls for items in the crate
@@ -16,11 +16,11 @@ Default passes for rustdoc:
16
16
collect-trait-impls
17
17
check_doc_test_visibility
18
18
check-doc-cfg
19
+ collect-intra-doc-links
19
20
strip-aliased-non-local
20
21
strip-hidden (when not --document-hidden-items)
21
22
strip-private (when not --document-private-items)
22
23
strip-priv-imports (when --document-private-items)
23
- collect-intra-doc-links
24
24
propagate-doc-cfg
25
25
propagate-stability
26
26
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