diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-08-22 18:05:52 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-08-22 20:27:57 +0200 |
| commit | 4de29c90478003ce28880e92986ee7f2fc9c2d33 (patch) | |
| tree | 236053f820fad7bf7caee07f4b3f38500cc0c3b8 | |
| parent | e37e15dc0bd9e4a21ced7a5c534c4c64dc3dfeda (diff) | |
| download | rust-4de29c90478003ce28880e92986ee7f2fc9c2d33.tar.gz rust-4de29c90478003ce28880e92986ee7f2fc9c2d33.zip | |
Add regression test for #126796
| -rw-r--r-- | tests/rustdoc/doc-hidden-crate.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/rustdoc/doc-hidden-crate.rs b/tests/rustdoc/doc-hidden-crate.rs new file mode 100644 index 00000000000..dac557107a9 --- /dev/null +++ b/tests/rustdoc/doc-hidden-crate.rs @@ -0,0 +1,27 @@ +// Regression test for <https://github.com/rust-lang/rust/issues/126796>. +// `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; + +//@ !has - '//*' 'myself' +#[doc(inline)] +pub use crate as myself; |
