-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate docs for links to private items when passed --document-private
- Pass around document_private a lot more - Add tests + Add tests for intra-doc links to private items + Add ignored tests for warnings in reference links
- Loading branch information
Showing
11 changed files
with
78 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
warning: `[DontDocMe]` public documentation for `DocMe` links to a private item | ||
--> $DIR/intra-links-private.rs:6:11 | ||
| | ||
LL | /// docs [DontDocMe] | ||
| ^^^^^^^^^ this item is private | ||
| | ||
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// check-pass | ||
// revisions: public private | ||
// [private]compile-flags: --document-private-items | ||
#![cfg_attr(private, deny(intra_doc_resolution_failure))] | ||
|
||
/// docs [DontDocMe] | ||
//[public]~^ WARNING `[DontDocMe]` public documentation for `DocMe` links to a private item | ||
// FIXME: for [private] we should also make sure the link was actually generated | ||
pub struct DocMe; | ||
struct DontDocMe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// ignore-test | ||
// check-pass | ||
|
||
/// docs [label][with#anchor#error] | ||
//~^ WARNING has an issue with the link anchor | ||
pub struct S; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
warning: `[with#anchor#error]` has an issue with the link anchor. | ||
--> $DIR/reference-link-has-one-warning.rs:3:18 | ||
| | ||
LL | /// docs [label][with#anchor#error] | ||
| ^^^^^^^^^^^^^^^^^ only one `#` is allowed in a link | ||
| | ||
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|