Skip to content

Commit

Permalink
Add regression test for #126796
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 22, 2024
1 parent 1a13c13 commit a1c2f9b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/rustdoc/doc-hidden-crate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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;

0 comments on commit a1c2f9b

Please sign in to comment.