]> git.lizzy.rs Git - rust.git/commit
rustdoc: Allow linking from private items to private types
authorDennis Hamester <dennis.hamester@gmail.com>
Wed, 8 Jul 2020 05:39:49 +0000 (07:39 +0200)
committerDennis Hamester <dennis.hamester@gmail.com>
Wed, 8 Jul 2020 06:15:34 +0000 (08:15 +0200)
commitc8b16cdbd0f06c66467c082b9d3e190255fa295d
tree9b11180af24feffbded13c968828fa436b259de9
parent8ac1525e091d3db28e67adcbbd6db1e1deaa37fb
rustdoc: Allow linking from private items to private types

Fixes #74134

After PR #72771 this would trigger an intra_doc_link_resolution_failure warning
when rustdoc is invoked without --document-private-items. Links from private
items to private types are however never actually generated in that case and
thus shouldn't produce a warning. These links are in fact a very useful tool to
document crate internals.

Tests are added for all 4 combinations of public/private items and link
targets. Test 1 is the case mentioned above and fails without this commit. Tests
2 - 4 passed before already but are added nonetheless to prevent regressions.
src/librustdoc/passes/collect_intra_doc_links.rs
src/test/rustdoc/issue-74134-1.rs [new file with mode: 0644]
src/test/rustdoc/issue-74134-2.rs [new file with mode: 0644]
src/test/rustdoc/issue-74134-3.rs [new file with mode: 0644]
src/test/rustdoc/issue-74134-4.rs [new file with mode: 0644]