-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 #87451 - GuillaumeGomez:tuple-struct-field-doc, r=jyn514
Add support for tuple struct field documentation Fixes #42615. This is #80320 updated to new codebase and with added tests. Part of #83255. cc ```@camelid``` (since you were involved on the original PR). r? ```@jyn514```
- Loading branch information
Showing
6 changed files
with
66 additions
and
19 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
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 | 75.0% | 0 | 0.0% | | ||
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 66.7% | 0 | 0.0% | | ||
+-------------------------------------+------------+------------+------------+------------+ | ||
| Total | 6 | 75.0% | 0 | 0.0% | | ||
| Total | 6 | 66.7% | 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
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,36 @@ | ||
#![crate_name = "foo"] | ||
|
||
// @has foo/struct.Foo.html | ||
// @has - '//h2[@id="fields"]' 'Tuple Fields' | ||
// @has - '//h3[@class="sidebar-title"]/a[@href="#fields"]' 'Tuple Fields' | ||
// @has - '//*[@id="structfield.0"]' '0: u32' | ||
// @has - '//*[@id="main"]/div[@class="docblock"]' 'hello' | ||
// @!has - '//*[@id="structfield.1"]' | ||
// @has - '//*[@id="structfield.2"]' '2: char' | ||
// @has - '//*[@id="structfield.3"]' '3: i8' | ||
// @has - '//*[@id="main"]/div[@class="docblock"]' 'not hello' | ||
pub struct Foo( | ||
/// hello | ||
pub u32, | ||
char, | ||
pub char, | ||
/// not hello | ||
pub i8, | ||
); | ||
|
||
// @has foo/enum.Bar.html | ||
// @has - '//pre[@class="rust enum"]' 'BarVariant(String),' | ||
// @matches - '//*[@id="variant.BarVariant.fields"]/h3' '^Tuple Fields of BarVariant$' | ||
// @has - '//*[@id="variant.BarVariant.field.0"]' '0: String' | ||
// @has - '//*[@id="variant.BarVariant.fields"]//*[@class="docblock"]' 'Hello docs' | ||
// @matches - '//*[@id="variant.FooVariant.fields"]/h3' '^Fields of FooVariant$' | ||
pub enum Bar { | ||
BarVariant( | ||
/// Hello docs | ||
String | ||
), | ||
FooVariant { | ||
/// hello | ||
x: u32, | ||
}, | ||
} |