Skip to content

Commit 4ea7bc9

Browse files
Don't generate #[doc(hidden)] elements
1 parent 298730e commit 4ea7bc9

File tree

4 files changed

+4
-22
lines changed

4 files changed

+4
-22
lines changed

src/librustdoc/html/render.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,9 @@ impl Context {
13691369
self.render_redirect_pages = self.maybe_ignore_item(&item);
13701370
}
13711371

1372-
if item.is_mod() {
1372+
if item.attrs.list("doc").has_word("hidden") {
1373+
Ok(())
1374+
} else if item.is_mod() {
13731375
// modules are special because they add a namespace. We also need to
13741376
// recurse into the items of the module as well.
13751377
let name = item.name.as_ref().unwrap().to_string();

src/librustdoc/passes.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult {
3737
debug!("found one in strip_hidden; removing");
3838
// use a dedicated hidden item for given item type if any
3939
match i.inner {
40-
clean::StructFieldItem(..) | clean::ModuleItem(..) => {
41-
return Strip(i).fold()
42-
}
43-
_ => return None,
40+
_ => return Strip(i).fold(),
4441
}
4542
} else {
4643
self.retained.insert(i.def_id);

src/test/rustdoc/issue-15347.rs

-15
This file was deleted.

src/test/rustdoc/redirect.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ pub trait Foo {}
1919
// @has redirect/index.html
2020
// @has - '//code' 'pub use reexp_stripped::Bar'
2121
// @has - '//code/a' 'Bar'
22-
// @has reexp_stripped/hidden/struct.Bar.html
23-
// @has - '//p/a' '../../reexp_stripped/struct.Bar.html'
2422
// @has 'reexp_stripped/struct.Bar.html'
2523
#[doc(no_inline)]
2624
pub use reexp_stripped::Bar;

0 commit comments

Comments
 (0)