]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Don't inline tuple struct constructors
authorAlex Crichton <alex@alexcrichton.com>
Thu, 29 May 2014 22:52:03 +0000 (15:52 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 1 Jun 2014 04:59:50 +0000 (21:59 -0700)
These don't actually point to anything, so there's no need to inline them.

src/librustdoc/clean/inline.rs

index 0c2714355dc24b6bc0a7c2c3be4c5e7c2db96607..65c60f2d3606de00a8dbb655004ea0b846f5a5c1 100644 (file)
@@ -62,6 +62,11 @@ fn try_inline_def(cx: &core::DocContext,
             clean::TraitItem(build_external_trait(tcx, did))
         }
         ast::DefFn(did, style) => {
+            // If this function is a tuple struct constructor, we just skip it
+            if csearch::get_tuple_struct_definition_if_ctor(&tcx.sess.cstore,
+                                                            did).is_some() {
+                return None
+            }
             record_extern_fqn(cx, did, clean::TypeFunction);
             clean::FunctionItem(build_external_function(tcx, did, style))
         }