Skip to content

Commit 92d29c1

Browse files
Rollup merge of #50032 - ollie27:rustdoc_all_private, r=GuillaumeGomez
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
2 parents 6f5fc47 + abded61 commit 92d29c1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/librustdoc/html/render.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,9 @@ impl Context {
17281728
let mut dst = try_err!(File::create(&joint_dst), &joint_dst);
17291729
try_err!(dst.write_all(&buf), &joint_dst);
17301730

1731-
all.append(full_path(self, &item), &item_type);
1731+
if !self.render_redirect_pages {
1732+
all.append(full_path(self, &item), &item_type);
1733+
}
17321734
// Redirect from a sane URL using the namespace to Rustdoc's
17331735
// URL for the page.
17341736
let redir_name = format!("{}.{}.html", name, item_type.name_space());

src/test/rustdoc/all.rs

+8
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ pub union Union {
2828
pub const CONST: u32 = 0;
2929
pub static STATIC: &str = "baguette";
3030
pub fn function() {}
31+
32+
mod private_module {
33+
pub struct ReexportedStruct;
34+
}
35+
36+
// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct'
37+
// @!has foo/all.html 'private_module'
38+
pub use private_module::ReexportedStruct;

0 commit comments

Comments
 (0)