From abded6111bcdaf53a74abb5188d81708180a364f Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Fri, 13 Apr 2018 14:58:43 +0100 Subject: [PATCH] rustdoc: Don't include private paths in all.html --- src/librustdoc/html/render.rs | 4 +++- src/test/rustdoc/all.rs | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 9e2c7bd7ef1ed..586d889722c17 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1728,7 +1728,9 @@ impl Context { let mut dst = try_err!(File::create(&joint_dst), &joint_dst); try_err!(dst.write_all(&buf), &joint_dst); - all.append(full_path(self, &item), &item_type); + if !self.render_redirect_pages { + all.append(full_path(self, &item), &item_type); + } // Redirect from a sane URL using the namespace to Rustdoc's // URL for the page. let redir_name = format!("{}.{}.html", name, item_type.name_space()); diff --git a/src/test/rustdoc/all.rs b/src/test/rustdoc/all.rs index ec391319b183c..1969cf859eee4 100644 --- a/src/test/rustdoc/all.rs +++ b/src/test/rustdoc/all.rs @@ -28,3 +28,11 @@ pub union Union { pub const CONST: u32 = 0; pub static STATIC: &str = "baguette"; pub fn function() {} + +mod private_module { + pub struct ReexportedStruct; +} + +// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct' +// @!has foo/all.html 'private_module' +pub use private_module::ReexportedStruct;