Skip to content

Commit

Permalink
Rollup merge of #50032 - ollie27:rustdoc_all_private, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
rustdoc: Don't include private paths in all.html

For example the `std` [`all.html`](https://doc.rust-lang.org/nightly/std/all.html) includes references to the `coresimd` module which is a private implementation detail.

r? @GuillaumeGomez
  • Loading branch information
GuillaumeGomez authored Apr 17, 2018
2 parents 6f5fc47 + abded61 commit 92d29c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
8 changes: 8 additions & 0 deletions src/test/rustdoc/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 92d29c1

Please sign in to comment.