Skip to content

Commit 61b5cc9

Browse files
committed
rustdoc: Add enums to the doc tree
1 parent b779277 commit 61b5cc9

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

src/rustdoc/doc.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ type moddoc = ~{
1414
desc: option<str>,
1515
mods: modlist,
1616
fns: fnlist,
17-
consts: constlist
17+
consts: constlist,
18+
enums: enumlist
1819
};
1920

2021
type constdoc = ~{
@@ -47,7 +48,22 @@ type retdoc = {
4748
ty: option<str>
4849
};
4950

51+
type enumdoc = ~{
52+
id: ast_id,
53+
name: str,
54+
brief: option<str>,
55+
desc: option<str>,
56+
variants: [variantdoc]
57+
};
58+
59+
type variantdoc = ~{
60+
name: str,
61+
desc: option<str>,
62+
sig: option<str>
63+
};
64+
5065
// Just to break the structural recursive types
5166
enum modlist = [moddoc];
5267
enum constlist = [constdoc];
5368
enum fnlist = [fndoc];
69+
enum enumlist = [enumdoc];

src/rustdoc/extract.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ fn moddoc_from_mod(
7676
none
7777
}
7878
}
79-
})
79+
}),
80+
enums: doc::enumlist([])
8081
}
8182
}
8283

src/rustdoc/rustdoc.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ fn test_run_passes() {
4747
desc: none,
4848
mods: doc::modlist([]),
4949
fns: doc::fnlist([]),
50-
consts: doc::constlist([])
50+
consts: doc::constlist([]),
51+
enums: doc::enumlist([])
5152
}
5253
}
5354
}
@@ -64,7 +65,8 @@ fn test_run_passes() {
6465
desc: none,
6566
mods: doc::modlist([]),
6667
fns: doc::fnlist([]),
67-
consts: doc::constlist([])
68+
consts: doc::constlist([]),
69+
enums: doc::enumlist([])
6870
}
6971
}
7072
}

0 commit comments

Comments
 (0)