1
Fork 0

rustdoc: Show macros in documentation

Any macro tagged with #[macro_export] will be showed in the documentation for
that module. This also documents all the existing macros inside of std::macros.

Closes #3163
cc #5605
Closes #9954
This commit is contained in:
Alex Crichton 2014-02-16 21:40:26 -08:00
parent f0cb0ebc66
commit 867988c1dc
7 changed files with 226 additions and 5 deletions

View file

@ -32,6 +32,7 @@ pub struct Module {
impls: ~[Impl],
foreigns: ~[ast::ForeignMod],
view_items: ~[ast::ViewItem],
macros: ~[Macro],
}
impl Module {
@ -52,6 +53,7 @@ impl Module {
impls : ~[],
view_items : ~[],
foreigns : ~[],
macros : ~[],
}
}
}
@ -157,6 +159,13 @@ pub struct Impl {
id: ast::NodeId,
}
pub struct Macro {
name: Ident,
id: ast::NodeId,
attrs: ~[ast::Attribute],
where: Span,
}
pub fn struct_type_from_def(sd: &ast::StructDef) -> StructType {
if sd.ctor_id.is_some() {
// We are in a tuple-struct