From fcc89ea5006441350f0275946ff6db84a1118e49 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 6 Apr 2015 16:43:55 -0700 Subject: rustdoc: Only hide possibly private modules If an empty public module has no documentation, it shouldn't emit a page that's just a redirect loop to itself! Closes #16265 --- src/test/rustdoc/issue-16265-1.rs | 18 ++++++++++++++++++ src/test/rustdoc/issue-16265-2.rs | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/test/rustdoc/issue-16265-1.rs create mode 100644 src/test/rustdoc/issue-16265-2.rs (limited to 'src/test/rustdoc') diff --git a/src/test/rustdoc/issue-16265-1.rs b/src/test/rustdoc/issue-16265-1.rs new file mode 100644 index 00000000000..c0b99a627ea --- /dev/null +++ b/src/test/rustdoc/issue-16265-1.rs @@ -0,0 +1,18 @@ +// Copyright 2015 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. + +pub struct Foo; + +// @has issue_16265_1/traits/index.html '[src]' +pub mod traits { + impl PartialEq for super::Foo { + fn eq(&self, _: &super::Foo) -> bool { true } + } +} diff --git a/src/test/rustdoc/issue-16265-2.rs b/src/test/rustdoc/issue-16265-2.rs new file mode 100644 index 00000000000..22a8df407e0 --- /dev/null +++ b/src/test/rustdoc/issue-16265-2.rs @@ -0,0 +1,15 @@ +// Copyright 2015 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. + + +// @has issue_16265_2/index.html '[src]' + +trait Y {} +impl Y for Option{} -- cgit 1.4.1-3-g733a5