Skip to content

Commit cc15c21

Browse files
authored
Rollup merge of #34536 - ollie27:rustdoc_module_impls, r=alexcrichton
rustdoc: Fix empty Implementations section on some module pages These are caused by `DefaultImpl`s. For example [`core::marker`](https://doc.rust-lang.org/nightly/core/marker/#impls).
2 parents b393c7e + f05da01 commit cc15c21

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/librustdoc/html/render.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1696,6 +1696,9 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
16961696
document(w, cx, item)?;
16971697

16981698
let mut indices = (0..items.len()).filter(|i| {
1699+
if let clean::DefaultImplItem(..) = items[*i].inner {
1700+
return false;
1701+
}
16991702
!cx.maybe_ignore_item(&items[*i])
17001703
}).collect::<Vec<usize>>();
17011704

src/test/rustdoc/module-impls.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_name = "foo"]
12+
13+
pub use std::marker::Send;
14+
15+
// @!has foo/index.html 'Implementations'

0 commit comments

Comments
 (0)