File tree Expand file tree Collapse file tree 6 files changed +58
-2
lines changed Expand file tree Collapse file tree 6 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -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 ) ,
9897 ConditionalPass :: always ( STRIP_ALIASED_NON_LOCAL ) ,
9998 ConditionalPass :: new ( STRIP_HIDDEN , WhenNotDocumentHidden ) ,
10099 ConditionalPass :: new ( STRIP_PRIVATE , WhenNotDocumentPrivate ) ,
101100 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 1+ // This test ensures that `doc(hidden)` items intra-doc links are checked whereas private
2+ // items are ignored.
3+
4+ //@ compile-flags: -Zunstable-options --document-hidden-items
5+
6+ #![ deny( rustdoc:: broken_intra_doc_links) ]
7+
8+ /// [not::exist]
9+ //~^ ERROR unresolved link to `not::exist`
10+ #[ doc( hidden) ]
11+ pub struct X ;
12+
13+ /// [not::exist]
14+ struct Y ;
Original file line number Diff line number Diff line change 1+ error: unresolved link to `not::exist`
2+ --> $DIR/hidden-check.rs:8:6
3+ |
4+ LL | /// [not::exist]
5+ | ^^^^^^^^^^ no item named `not` in scope
6+ |
7+ note: the lint level is defined here
8+ --> $DIR/hidden-check.rs:6:9
9+ |
10+ LL | #![deny(rustdoc::broken_intra_doc_links)]
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+ error: aborting due to 1 previous error
14+
Original file line number Diff line number Diff line change 1+ // This test ensures that private items intra-doc links are checked whereas `doc(hidden)`
2+ // items are ignored.
3+
4+ //@ compile-flags: -Zunstable-options --document-private-items
5+
6+ #![ deny( rustdoc:: broken_intra_doc_links) ]
7+
8+ /// [not::exist]
9+ #[ doc( hidden) ]
10+ pub struct X ;
11+
12+ /// [not::exist]
13+ //~^ ERROR unresolved link to `not::exist`
14+ struct Y ;
Original file line number Diff line number Diff line change 1+ error: unresolved link to `not::exist`
2+ --> $DIR/private-check.rs:12:6
3+ |
4+ LL | /// [not::exist]
5+ | ^^^^^^^^^^ no item named `not` in scope
6+ |
7+ note: the lint level is defined here
8+ --> $DIR/private-check.rs:6:9
9+ |
10+ LL | #![deny(rustdoc::broken_intra_doc_links)]
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+ error: aborting due to 1 previous error
14+
Original file line number Diff line number Diff line change @@ -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
2019strip-aliased-non-local
2120 strip-hidden (when not --document-hidden-items)
2221 strip-private (when not --document-private-items)
2322 strip-priv-imports (when --document-private-items)
23+ collect-intra-doc-links
2424 propagate-doc-cfg
2525 propagate-stability
2626 run-lints
You can’t perform that action at this time.
0 commit comments