]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Don't include private paths in all.html
authorOliver Middleton <olliemail27@gmail.com>
Fri, 13 Apr 2018 13:58:43 +0000 (14:58 +0100)
committerOliver Middleton <olliemail27@gmail.com>
Fri, 13 Apr 2018 13:58:43 +0000 (14:58 +0100)
src/librustdoc/html/render.rs
src/test/rustdoc/all.rs

index 9e2c7bd7ef1ed6fc808192442760279ac88b7a76..586d889722c1785f12b6dbedebbed5eb899e07c3 100644 (file)
@@ -1728,7 +1728,9 @@ fn item<F>(&mut self, item: clean::Item, all: &mut AllTypes, mut f: F) -> Result
                 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());
index ec391319b183ce48475f7dd1d885e418bf3b9a3f..1969cf859eee4c8e9a50f89b0ea78c5152e341c1 100644 (file)
@@ -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;