From f05da01dbe3ce8e7460a1d47d489f85a1fa1cbb7 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Tue, 28 Jun 2016 22:50:44 +0100 Subject: [PATCH] rustdoc: Fix empty Implementations section on some module pages These are caused by `DefaultImpl`s. --- src/librustdoc/html/render.rs | 3 +++ src/test/rustdoc/module-impls.rs | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/test/rustdoc/module-impls.rs diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index f63d37b34032e..48acf31b99367 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1696,6 +1696,9 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context, document(w, cx, item)?; let mut indices = (0..items.len()).filter(|i| { + if let clean::DefaultImplItem(..) = items[*i].inner { + return false; + } !cx.maybe_ignore_item(&items[*i]) }).collect::>(); diff --git a/src/test/rustdoc/module-impls.rs b/src/test/rustdoc/module-impls.rs new file mode 100644 index 0000000000000..7be3c50073166 --- /dev/null +++ b/src/test/rustdoc/module-impls.rs @@ -0,0 +1,15 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_name = "foo"] + +pub use std::marker::Send; + +// @!has foo/index.html 'Implementations'