-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #129414 - GuillaumeGomez:fix-doc-hidden-crates, r=not…
…riddle Fix extern crates not being hidden with `doc(hidden)` Fixes #126796. Only the current crate should never be stripped, any other crate should be strippable. r? ``@notriddle``
- Loading branch information
Showing
2 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |