-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rustdoc-Json: More accurate struct type.
Closes #101489
- Loading branch information
1 parent
78a891d
commit 1c8de17
Showing
15 changed files
with
118 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pub struct Demo { | ||
pub x: i32, | ||
pub y: i32, | ||
} | ||
|
||
// @set x = "$.index[*][?(@.name=='x')].id" | ||
// @set y = "$.index[*][?(@.name=='y')].id" | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[1]" $y | ||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 2 | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" false |
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 @@ | ||
pub struct Demo { | ||
pub x: i32, | ||
#[doc(hidden)] | ||
pub y: i32, | ||
} | ||
|
||
// @set x = "$.index[*][?(@.name=='x')].id" | ||
// @!has "$.index[*][?(@.name=='y')].id" | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x | ||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 1 | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" true |
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,6 +1,5 @@ | ||
// @has "$.index[*][?(@.name=='PlainEmpty')].visibility" \"public\" | ||
// @has "$.index[*][?(@.name=='PlainEmpty')].kind" \"struct\" | ||
// @has "$.index[*][?(@.name=='PlainEmpty')].inner.struct_type" \"plain\" | ||
// @has "$.index[*][?(@.name=='PlainEmpty')].inner.fields_stripped" false | ||
// @has "$.index[*][?(@.name=='PlainEmpty')].inner.fields" [] | ||
// @is "$.index[*][?(@.name=='PlainEmpty')].visibility" \"public\" | ||
// @is "$.index[*][?(@.name=='PlainEmpty')].kind" \"struct\" | ||
// @is "$.index[*][?(@.name=='PlainEmpty')].inner.kind.plain.fields_stripped" false | ||
// @is "$.index[*][?(@.name=='PlainEmpty')].inner.kind.plain.fields" [] | ||
pub struct PlainEmpty {} |
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,9 @@ | ||
pub struct Demo { | ||
pub x: i32, | ||
y: i32, | ||
} | ||
|
||
// @set x = "$.index[*][?(@.name=='x')].id" | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x | ||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 1 | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" true |
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,5 +1,4 @@ | ||
// @has "$.index[*][?(@.name=='Tuple')].visibility" \"public\" | ||
// @has "$.index[*][?(@.name=='Tuple')].kind" \"struct\" | ||
// @has "$.index[*][?(@.name=='Tuple')].inner.struct_type" \"tuple\" | ||
// @has "$.index[*][?(@.name=='Tuple')].inner.fields_stripped" true | ||
// @is "$.index[*][?(@.name=='Tuple')].visibility" \"public\" | ||
// @is "$.index[*][?(@.name=='Tuple')].kind" \"struct\" | ||
// @is "$.index[*][?(@.name=='Tuple')].inner.kind.tuple" '[null, null]' | ||
pub struct Tuple(u32, String); |
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,2 @@ | ||
// @is "$.index[*][?(@.name=='TupleUnit')].inner.kind.tuple" [] | ||
pub struct TupleUnit(); |
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,13 @@ | ||
pub struct Demo( | ||
i32, | ||
/// field | ||
pub i32, | ||
#[doc(hidden)] i32, | ||
); | ||
|
||
// @set field = "$.index[*][?(@.docs=='field')].id" | ||
|
||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[0]" null | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[1]" $field | ||
// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[2]" null | ||
// @count "$.index[*][?(@.name=='Demo')].inner.kind.tuple[*]" 3 |
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,5 +1,4 @@ | ||
// @has "$.index[*][?(@.name=='Unit')].visibility" \"public\" | ||
// @has "$.index[*][?(@.name=='Unit')].kind" \"struct\" | ||
// @has "$.index[*][?(@.name=='Unit')].inner.struct_type" \"unit\" | ||
// @has "$.index[*][?(@.name=='Unit')].inner.fields" [] | ||
// @is "$.index[*][?(@.name=='Unit')].visibility" \"public\" | ||
// @is "$.index[*][?(@.name=='Unit')].kind" \"struct\" | ||
// @is "$.index[*][?(@.name=='Unit')].inner.kind" \"unit\" | ||
pub struct Unit; |
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