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

@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe`
LL | /// docs [DontDocMe]
| ^^^^^^^^^ this item is private
|
= note: `#[warn(broken_intra_doc_links)]` on by default
= note: `#[warn(private_intra_doc_links)]` on by default
= note: this link resolves only because you passed `--document-private-items`, but will break without
warning: 1 warning emitted

View file

@ -4,7 +4,7 @@ warning: public documentation for `DocMe` links to private item `DontDocMe`
LL | /// docs [DontDocMe]
| ^^^^^^^^^ this item is private
|
= note: `#[warn(broken_intra_doc_links)]` on by default
= note: `#[warn(private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`
warning: 1 warning emitted

View file

@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy
LL | /// [`PrivateType`]
| ^^^^^^^^^^^^^ this item is private
|
= note: `#[warn(broken_intra_doc_links)]` on by default
= note: `#[warn(private_intra_doc_links)]` on by default
= note: this link resolves only because you passed `--document-private-items`, but will break without
warning: 1 warning emitted

View file

@ -4,7 +4,7 @@ warning: public documentation for `public_item` links to private item `PrivateTy
LL | /// [`PrivateType`]
| ^^^^^^^^^^^^^ this item is private
|
= note: `#[warn(broken_intra_doc_links)]` on by default
= note: `#[warn(private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`
warning: 1 warning emitted

View file

@ -0,0 +1,6 @@
#![crate_name = "private"]
// compile-flags: --document-private-items
/// docs [DontDocMe]
// @has private/struct.DocMe.html '//*a[@href="../private/struct.DontDocMe.html"]' 'DontDocMe'
pub struct DocMe;
struct DontDocMe;