File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed
tests/rustdoc-ui/intra-doc Expand file tree Collapse file tree 4 files changed +56
-0
lines changed 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+
You can’t perform that action at this time.
0 commit comments