Skip to content

Commit 4de29c9

Browse files
Add regression test for rust-lang#126796
1 parent e37e15d commit 4de29c9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/rustdoc/doc-hidden-crate.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/126796>.
2+
// `doc(hidden)` should still be able to hide extern crates, only the local crates
3+
// cannot be hidden because we still need to generate its `index.html` file.
4+
5+
#![crate_name = "foo"]
6+
#![doc(hidden)]
7+
8+
//@ has 'foo/index.html'
9+
// First we check that the page contains the crate name (`foo`).
10+
//@ has - '//*' 'foo'
11+
// But doesn't contain any of the other items.
12+
//@ !has - '//*' 'other'
13+
//@ !has - '//*' 'marker'
14+
//@ !has - '//*' 'PhantomData'
15+
16+
#[doc(inline)]
17+
pub use std as other;
18+
19+
#[doc(inline)]
20+
pub use std::marker;
21+
22+
#[doc(inline)]
23+
pub use std::marker::PhantomData;
24+
25+
//@ !has - '//*' 'myself'
26+
#[doc(inline)]
27+
pub use crate as myself;

0 commit comments

Comments
 (0)