about summary refs log tree commit diff
path: root/tests/rustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-04-04 18:10:52 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-04-04 18:10:52 +0200
commit5a0be6ff3dcc89a14e22c8613c86acbb0cd55b4a (patch)
treecd9e54aa773e048baddc7cd780d75a0215b5f6e5 /tests/rustdoc
parent0ee34e1914e6d12447b0859b8c1c4e6601c6be68 (diff)
downloadrust-5a0be6ff3dcc89a14e22c8613c86acbb0cd55b4a.tar.gz
rust-5a0be6ff3dcc89a14e22c8613c86acbb0cd55b4a.zip
Add regression test for #123435
Diffstat (limited to 'tests/rustdoc')
-rw-r--r--tests/rustdoc/inline_cross/inline_hidden.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/rustdoc/inline_cross/inline_hidden.rs b/tests/rustdoc/inline_cross/inline_hidden.rs
index ec06f2f0c5d..2a3dd72749c 100644
--- a/tests/rustdoc/inline_cross/inline_hidden.rs
+++ b/tests/rustdoc/inline_cross/inline_hidden.rs
@@ -4,9 +4,23 @@
 
 extern crate rustdoc_hidden;
 
+// @has inline_hidden/index.html
+// Ensures this item is not inlined.
+// @has - '//*[@id="reexport.Foo"]/code' 'pub use rustdoc_hidden::Foo;'
 #[doc(no_inline)]
 pub use rustdoc_hidden::Foo;
 
+// Even if the foreign item has `doc(hidden)`, we should be able to inline it.
+// @has - '//*[@class="item-name"]/a[@class="struct"]' 'Inlined'
+#[doc(inline)]
+pub use rustdoc_hidden::Foo as Inlined;
+
+// Even with this import, we should not see `Foo`.
+// @count - '//*[@class="item-name"]' 4
+// @has - '//*[@class="item-name"]/a[@class="struct"]' 'Bar'
+// @has - '//*[@class="item-name"]/a[@class="fn"]' 'foo'
+pub use rustdoc_hidden::*;
+
 // @has inline_hidden/fn.foo.html
 // @!has - '//a/@title' 'Foo'
 pub fn foo(_: Foo) {}