about summary refs log tree commit diff
path: root/tests/rustdoc/doc-hidden-source.rs
diff options
context:
space:
mode:
authorxizheyin <xizheyin@smail.nju.edu.cn>2025-02-27 20:54:26 +0800
committerxizheyin <xizheyin@smail.nju.edu.cn>2025-03-04 01:35:48 +0800
commit133705c402941c0825fe658a932289847478cf9f (patch)
tree3dadcfce60003adfd40d473836e81efd5d845104 /tests/rustdoc/doc-hidden-source.rs
parent96cfc75584359ae7ad11cc45968059f29e7b44b7 (diff)
downloadrust-133705c402941c0825fe658a932289847478cf9f.tar.gz
rust-133705c402941c0825fe658a932289847478cf9f.zip
[rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden)
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Diffstat (limited to 'tests/rustdoc/doc-hidden-source.rs')
-rw-r--r--tests/rustdoc/doc-hidden-source.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/rustdoc/doc-hidden-source.rs b/tests/rustdoc/doc-hidden-source.rs
new file mode 100644
index 00000000000..b6bc622dd58
--- /dev/null
+++ b/tests/rustdoc/doc-hidden-source.rs
@@ -0,0 +1,16 @@
+// Test for <https://github.com/rust-lang/rust/issues/137342>.
+
+#![crate_name = "foo"]
+
+//@ has 'foo/index.html'
+//@ !has - '//*[@id="main-content"]//*[@class="struct"]' 'Bar'
+#[doc(hidden)]
+pub struct Bar;
+
+//@ !has - '//*' 'pub use crate::Bar as A;'
+pub use crate::Bar as A;
+//@ !has - '//*' 'pub use crate::A as B;'
+pub use crate::A as B;
+//@ has - '//dt/a[@class="struct"]' 'C'
+#[doc(inline)]
+pub use crate::Bar as C;