From 8ef455190494d2fd9a6bb013efd2e59622af2bc4 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sat, 25 Aug 2012 15:09:33 -0700 Subject: rustc: Implement foreign constants. This is needed for a lot of Apple libraries, as Apple tends to put a lot of globals in dynamic libraries. --- src/rustdoc/extract.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/rustdoc') diff --git a/src/rustdoc/extract.rs b/src/rustdoc/extract.rs index 6ab1aa78cc0..66b67552b13 100644 --- a/src/rustdoc/extract.rs +++ b/src/rustdoc/extract.rs @@ -130,16 +130,19 @@ fn nmoddoc_from_mod( itemdoc: doc::itemdoc, module_: ast::foreign_mod ) -> doc::nmoddoc { + let mut fns = ~[]; + for module_.items.each |item| { + let itemdoc = mk_itemdoc(item.id, to_str(item.ident)); + match item.node { + ast::foreign_item_fn(*) => { + vec::push(fns, fndoc_from_fn(itemdoc)); + } + ast::foreign_item_const(*) => {} // XXX: Not implemented. + } + } { item: itemdoc, - fns: do vec::map(module_.items) |item| { - let itemdoc = mk_itemdoc(item.id, to_str(item.ident)); - match item.node { - ast::foreign_item_fn(*) => { - fndoc_from_fn(itemdoc) - } - } - }, + fns: fns, index: none } } -- cgit 1.4.1-3-g733a5