about summary refs log tree commit diff
path: root/tests/rustdoc
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev+love@gmail.com>2023-01-13 05:47:23 +0900
committerGitHub <noreply@github.com>2023-01-13 05:47:23 +0900
commitea45b3ef1da79a821aec3c081df6e24e34cdcedc (patch)
treea491254a07de429b81915110a28a0208a469b269 /tests/rustdoc
parent7e5d477ac555d145ad4dcabd78ef8900f377a017 (diff)
parent675640c92a1fb1de99227802851fd2811d1ebd08 (diff)
downloadrust-ea45b3ef1da79a821aec3c081df6e24e34cdcedc.tar.gz
rust-ea45b3ef1da79a821aec3c081df6e24e34cdcedc.zip
Rollup merge of #106741 - GuillaumeGomez:reexport-doc-hidden, r=notriddle
Fix reexport of `doc(hidden)` item

Part of #59368.

It doesn't fix the `doc(inline)` nor the `doc(hidden)` on macro. I'll do it in a follow-up PR.

r? `@notriddle`
Diffstat (limited to 'tests/rustdoc')
-rw-r--r--tests/rustdoc/reexport-doc-hidden.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/rustdoc/reexport-doc-hidden.rs b/tests/rustdoc/reexport-doc-hidden.rs
new file mode 100644
index 00000000000..3ea5fde72f7
--- /dev/null
+++ b/tests/rustdoc/reexport-doc-hidden.rs
@@ -0,0 +1,26 @@
+// Part of <https://github.com/rust-lang/rust/issues/59368>.
+// This test ensures that reexporting a `doc(hidden)` item will
+// still show the reexport.
+
+#![crate_name = "foo"]
+
+#[doc(hidden)]
+pub type Type = u32;
+
+// @has 'foo/index.html'
+// @has - '//*[@id="reexport.Type2"]/code' 'pub use crate::Type as Type2;'
+pub use crate::Type as Type2;
+
+// @count - '//*[@id="reexport.Type3"]' 0
+#[doc(hidden)]
+pub use crate::Type as Type3;
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! foo {
+    () => {};
+}
+
+// This is a bug: https://github.com/rust-lang/rust/issues/59368
+// @!has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;'
+pub use crate::foo as Macro;