Skip to content

Commit 31f5de6

Browse files
committed
rustdoc: Don't inline tuple struct constructors
These don't actually point to anything, so there's no need to inline them.
1 parent 7ec6df5 commit 31f5de6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustdoc/clean/inline.rs

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ fn try_inline_def(cx: &core::DocContext,
6262
clean::TraitItem(build_external_trait(tcx, did))
6363
}
6464
ast::DefFn(did, style) => {
65+
// If this function is a tuple struct constructor, we just skip it
66+
if csearch::get_tuple_struct_definition_if_ctor(&tcx.sess.cstore,
67+
did).is_some() {
68+
return None
69+
}
6570
record_extern_fqn(cx, did, clean::TypeFunction);
6671
clean::FunctionItem(build_external_function(tcx, did, style))
6772
}

0 commit comments

Comments
 (0)