From a1c2f9bcf397baa72bf88f2bf7c35eac4c3e3023 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 22 Aug 2024 18:05:52 +0200 Subject: [PATCH] Add regression test for #126796 --- tests/rustdoc/doc-hidden-crate.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/rustdoc/doc-hidden-crate.rs diff --git a/tests/rustdoc/doc-hidden-crate.rs b/tests/rustdoc/doc-hidden-crate.rs new file mode 100644 index 0000000000000..04574d3379c0b --- /dev/null +++ b/tests/rustdoc/doc-hidden-crate.rs @@ -0,0 +1,23 @@ +// Regression test for . +// `doc(hidden)` should still be able to hide extern crates, only the local crates +// cannot be hidden because we still need to generate its `index.html` file. + +#![crate_name = "foo"] +#![doc(hidden)] + +//@ has 'foo/index.html' +// First we check that the page contains the crate name (`foo`). +//@ has - '//*' 'foo' +// But doesn't contain any of the other items. +//@ !has - '//*' 'other' +//@ !has - '//*' 'marker' +//@ !has - '//*' 'PhantomData' + +#[doc(inline)] +pub use std as other; + +#[doc(inline)] +pub use std::marker; + +#[doc(inline)] +pub use std::marker::PhantomData;