diff --git a/src/rustdoc/doc.rs b/src/rustdoc/doc.rs index f4541e85491..aa1bca2eab9 100644 --- a/src/rustdoc/doc.rs +++ b/src/rustdoc/doc.rs @@ -33,7 +33,8 @@ type itemdoc = { type moddoc = { item: itemdoc, - items: [itemtag] + items: [itemtag], + index: option }; type nmoddoc = { @@ -109,6 +110,29 @@ type tydoc = { sig: option }; +type index = { + entries: [index_entry] +}; + +#[doc = " + +A single entry in an index + +Fields: + +* kind - The type of thing being indexed, e.g. 'Module' +* name - The name of the thing +* brief - A description +* link - A format-specific string representing the link target + +"] +type index_entry = { + kind: str, + name: str, + brief: str, + link: str +}; + #[doc = "Some helper methods on moddoc, mostly for testing"] impl util for moddoc { diff --git a/src/rustdoc/extract.rs b/src/rustdoc/extract.rs index 21f60fc8f66..27ad5fe51ba 100644 --- a/src/rustdoc/extract.rs +++ b/src/rustdoc/extract.rs @@ -102,7 +102,8 @@ fn moddoc_from_mod( none } } - } + }, + index: none } } diff --git a/src/rustdoc/rustdoc.rs b/src/rustdoc/rustdoc.rs index ae450fbac4c..86af77a687f 100755 --- a/src/rustdoc/rustdoc.rs +++ b/src/rustdoc/rustdoc.rs @@ -57,7 +57,8 @@ fn test_run_passes() { name: doc.topmod.name() + "two" with doc.topmod.item }, - items: [] + items: [], + index: none } } } @@ -71,7 +72,8 @@ fn test_run_passes() { name: doc.topmod.name() + "three" with doc.topmod.item }, - items: [] + items: [], + index: none } } }