Skip to content

Commit bba939e

Browse files
authored
Rollup merge of #101914 - aDotInTheVoid:rdj-path-union-docs, r=jsha
rustdoc-json-types: Document that ResolvedPath can also be a union r? rustdoc
2 parents b1178af + cb6c923 commit bba939e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/rustdoc-json-types/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ pub enum Term {
542542
#[serde(rename_all = "snake_case")]
543543
#[serde(tag = "kind", content = "inner")]
544544
pub enum Type {
545-
/// Structs and enums
545+
/// Structs, enums, and unions
546546
ResolvedPath(Path),
547547
DynTrait(DynTrait),
548548
/// Parameterized types

src/test/rustdoc-json/unions/union.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
// @has "$.index[*][?(@.name=='Union')].visibility" \"public\"
22
// @has "$.index[*][?(@.name=='Union')].kind" \"union\"
33
// @!has "$.index[*][?(@.name=='Union')].inner.struct_type"
4+
// @set Union = "$.index[*][?(@.name=='Union')].id"
45
pub union Union {
56
int: i32,
67
float: f32,
78
}
9+
10+
11+
// @is "$.index[*][?(@.name=='make_int_union')].inner.decl.output.kind" '"resolved_path"'
12+
// @is "$.index[*][?(@.name=='make_int_union')].inner.decl.output.inner.id" $Union
13+
pub fn make_int_union(int: i32) -> Union {
14+
Union { int }
15+
}

0 commit comments

Comments
 (0)