about summary refs log tree commit diff
path: root/src/rustdoc
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-08-25 15:09:33 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-08-25 15:09:33 -0700
commit8ef455190494d2fd9a6bb013efd2e59622af2bc4 (patch)
tree79b59597ad931e5be3d5440f50c8942a53e3e495 /src/rustdoc
parentbb5c07922f20559af1e40d63a15b1be0402e5fe4 (diff)
downloadrust-8ef455190494d2fd9a6bb013efd2e59622af2bc4.tar.gz
rust-8ef455190494d2fd9a6bb013efd2e59622af2bc4.zip
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.
Diffstat (limited to 'src/rustdoc')
-rw-r--r--src/rustdoc/extract.rs19
1 files changed, 11 insertions, 8 deletions
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
     }
 }