about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-10-31 15:00:35 +1300
committerNick Cameron <ncameron@mozilla.com>2014-11-01 11:05:12 +1300
commit060566f08a5c6b2343880516799971755183744f (patch)
treec38cb8832d54949ec5619656da528b9a9cf9767f
parent2474d7d2c44a8684925838abc8ef7729d2997a05 (diff)
downloadrust-060566f08a5c6b2343880516799971755183744f.tar.gz
rust-060566f08a5c6b2343880516799971755183744f.zip
Fix RustDoc bug
-rw-r--r--src/librustdoc/clean/inline.rs17
-rw-r--r--src/librustdoc/clean/mod.rs2
2 files changed, 9 insertions, 10 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index 967e1fbb700..d87d8776d4a 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -73,10 +73,10 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
             record_extern_fqn(cx, did, clean::TypeTrait);
             clean::TraitItem(build_external_trait(cx, tcx, did))
         }
-        def::DefFn(did, style, false) => {
+        def::DefFn(did, false) => {
             // If this function is a tuple struct constructor, we just skip it
             record_extern_fqn(cx, did, clean::TypeFunction);
-            clean::FunctionItem(build_external_function(cx, tcx, did, style))
+            clean::FunctionItem(build_external_function(cx, tcx, did))
         }
         def::DefStruct(did) => {
             record_extern_fqn(cx, did, clean::TypeStruct);
@@ -167,15 +167,14 @@ pub fn build_external_trait(cx: &DocContext, tcx: &ty::ctxt,
     }
 }
 
-fn build_external_function(cx: &DocContext, tcx: &ty::ctxt,
-                           did: ast::DefId,
-                           style: ast::FnStyle) -> clean::Function {
+fn build_external_function(cx: &DocContext, tcx: &ty::ctxt, did: ast::DefId) -> clean::Function {
     let t = ty::lookup_item_type(tcx, did);
+    let (decl, style) = match ty::get(t.ty).sty {
+        ty::ty_bare_fn(ref f) => ((did, &f.sig).clean(cx), f.fn_style),
+        _ => panic!("bad function"),
+    };
     clean::Function {
-        decl: match ty::get(t.ty).sty {
-            ty::ty_bare_fn(ref f) => (did, &f.sig).clean(cx),
-            _ => panic!("bad function"),
-        },
+        decl: decl,
         generics: (&t.generics, subst::FnSpace).clean(cx),
         fn_style: style,
     }
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 7c8f4ba8f65..c128588918e 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -2124,7 +2124,7 @@ fn resolve_type(cx: &DocContext, path: Path,
 
 fn register_def(cx: &DocContext, def: def::Def) -> ast::DefId {
     let (did, kind) = match def {
-        def::DefFn(i, _, _) => (i, TypeFunction),
+        def::DefFn(i, _) => (i, TypeFunction),
         def::DefTy(i, false) => (i, TypeTypedef),
         def::DefTy(i, true) => (i, TypeEnum),
         def::DefTrait(i) => (i, TypeTrait),