-
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.
Rollup merge of #88720 - GuillaumeGomez:rustdoc-coverage-fields-count…
…, r=Manishearth Rustdoc coverage fields count Follow-up of #88688. Instead of requiring enum tuple variant fields and tuple struct fields to be documented, we count them if they are documented, otherwise we don't include them in the count. r? `@Manishearth`
- Loading branch information
Showing
6 changed files
with
108 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// compile-flags:-Z unstable-options --show-coverage | ||
// check-pass | ||
|
||
// The point of this test is to ensure that the number of "documented" items | ||
// is higher than in `enum-tuple.rs`. | ||
|
||
//! (remember the crate root is still a module) | ||
/// so check out this enum here | ||
pub enum ThisEnum { | ||
/// VarOne. | ||
VarOne( | ||
/// hello! | ||
String, | ||
), | ||
/// Var Two. | ||
VarTwo( | ||
/// Hello | ||
String, | ||
/// Bis repetita. | ||
String, | ||
), | ||
} | ||
|
||
/// Struct. | ||
pub struct ThisStruct( | ||
/// hello | ||
u32, | ||
); | ||
|
||
/// Struct. | ||
pub struct ThisStruct2( | ||
/// hello | ||
u32, | ||
/// Bis repetita. | ||
u8, | ||
); |
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,7 @@ | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| File | Documented | Percentage | Examples | Percentage | | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| ...overage/enum-tuple-documented.rs | 9 | 100.0% | 0 | 0.0% | | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| Total | 9 | 100.0% | 0 | 0.0% | | ||
+-------------------------------------+------------+------------+------------+------------+ |
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 @@ | ||
// compile-flags:-Z unstable-options --show-coverage | ||
// check-pass | ||
|
||
//! (remember the crate root is still a module) | ||
/// so check out this enum here | ||
pub enum ThisEnum { | ||
/// No need to document the field if there is only one in a tuple variant! | ||
VarOne(String), | ||
/// But if there is more than one... still fine! | ||
VarTwo(String, String), | ||
} | ||
|
||
/// Struct. | ||
pub struct ThisStruct(u32); | ||
|
||
/// Struct. | ||
pub struct ThisStruct2(u32, u8); |
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,7 @@ | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| File | Documented | Percentage | Examples | Percentage | | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| ...ustdoc-ui/coverage/enum-tuple.rs | 6 | 100.0% | 0 | 0.0% | | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| Total | 6 | 100.0% | 0 | 0.0% | | ||
+-------------------------------------+------------+------------+------------+------------+ |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| File | Documented | Percentage | Examples | Percentage | | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 66.7% | 0 | 0.0% | | ||
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 75.0% | 0 | 0.0% | | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| Total | 6 | 66.7% | 0 | 0.0% | | ||
| Total | 6 | 75.0% | 0 | 0.0% | | ||
+-------------------------------------+------------+------------+------------+------------+ |