-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve rustdoc::private_doc_tests tests
- Ensure standard public items are accepted - Ensure public items not re-exported from private modules are denied
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(rustdoc::private_doc_tests)] | ||
|
||
mod foo { | ||
/// private doc test | ||
/// | ||
/// ``` | ||
/// assert!(false); | ||
/// ``` | ||
//~^^^^^ ERROR documentation test in private item | ||
pub fn bar() {} | ||
} |
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,18 @@ | ||
error: documentation test in private item | ||
--> $DIR/private-public-item-doc-test.rs:4:5 | ||
| | ||
LL | / /// private doc test | ||
LL | | /// | ||
LL | | /// ``` | ||
LL | | /// assert!(false); | ||
LL | | /// ``` | ||
| |___________^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/private-public-item-doc-test.rs:1:9 | ||
| | ||
LL | #![deny(rustdoc::private_doc_tests)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
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