Skip to content

Commit 6ee7ff5

Browse files
committed
rustdoc: Add consts to the doc tree
1 parent a3c31a0 commit 6ee7ff5

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/rustdoc/doc.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ type moddoc = ~{
1313
brief: option<str>,
1414
desc: option<str>,
1515
mods: modlist,
16-
fns: fnlist
16+
fns: fnlist,
17+
consts: constlist
18+
};
19+
20+
type constdoc = ~{
21+
id: ast_id,
22+
name: str,
23+
ty: option<str>
1724
};
1825

1926
type fndoc = ~{
@@ -39,4 +46,5 @@ type retdoc = {
3946

4047
// Just to break the structural recursive types
4148
enum modlist = [moddoc];
49+
enum constlist = [constdoc];
4250
enum fnlist = [fndoc];

src/rustdoc/extract.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ fn moddoc_from_mod(
6565
none
6666
}
6767
}
68-
})
68+
}),
69+
consts: doc::constlist([])
6970
}
7071
}
7172

src/rustdoc/rustdoc.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ fn test_run_passes() {
4646
brief: none,
4747
desc: none,
4848
mods: doc::modlist([]),
49-
fns: doc::fnlist([])
49+
fns: doc::fnlist([]),
50+
consts: doc::constlist([])
5051
}
5152
}
5253
}
@@ -62,7 +63,8 @@ fn test_run_passes() {
6263
brief: none,
6364
desc: none,
6465
mods: doc::modlist([]),
65-
fns: doc::fnlist([])
66+
fns: doc::fnlist([]),
67+
consts: doc::constlist([])
6668
}
6769
}
6870
}

0 commit comments

Comments
 (0)