1
Fork 0

Separate private_intra_doc_links and broken_intra_doc_links into separate lints

This is not ideal because it means `deny(broken_intra_doc_links)` will
no longer `deny(private_intra_doc_links)`. However, it can't be fixed
with a new lint group, because `broken` is already in the `rustdoc` lint
group; there would need to be a way to nest groups somehow.

This also removes the early `return` so that the link will be generated
even though it gives a warning.
This commit is contained in:
Joshua Nelson 2020-09-26 21:27:55 -04:00
parent b8363295d5
commit 03d8be0896
8 changed files with 35 additions and 12 deletions

View file

@ -1826,6 +1826,17 @@ declare_lint! {
"failures in resolving intra-doc link targets"
}
declare_lint! {
/// This is a subset of `broken_intra_doc_links` that warns when linking from
/// a public item to a private one. This is a `rustdoc` only lint, see the
/// documentation in the [rustdoc book].
///
/// [rustdoc book]: ../../../rustdoc/lints.html#broken_intra_doc_links
pub PRIVATE_INTRA_DOC_LINKS,
Warn,
"linking from a public item to a private one"
}
declare_lint! {
/// The `invalid_codeblock_attributes` lint detects code block attributes
/// in documentation examples that have potentially mis-typed values. This