-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #108241 - GuillaumeGomez:fix-reexported-macro-handlin…
…g, r=notriddle Fix handling of reexported macro in doc hidden items Fixes #108231. Fixes #59368. r? `@notriddle`
- Loading branch information
Showing
3 changed files
with
58 additions
and
5 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,23 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/108231>. | ||
// Macros with `#[macro_export]` attribute should be visible at the top level | ||
// even if they are inside a doc hidden item. | ||
|
||
#![crate_name = "foo"] | ||
|
||
// @has 'foo/index.html' | ||
// @count - '//*[@id="main-content"]//a[@class="macro"]' 1 | ||
// @has - '//*[@id="main-content"]//a[@class="macro"]' 'foo' | ||
|
||
#[doc(hidden)] | ||
pub mod __internal { | ||
/// This one should be visible. | ||
#[macro_export] | ||
macro_rules! foo { | ||
() => {}; | ||
} | ||
|
||
/// This one should be hidden. | ||
macro_rules! bar { | ||
() => {}; | ||
} | ||
} |
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,22 @@ | ||
// Ensure that inlined reexport of hidden macros is working as expected. | ||
// Part of <https://github.com/rust-lang/rust/issues/59368>. | ||
|
||
#![crate_name = "foo"] | ||
|
||
// @has 'foo/index.html' | ||
// @has - '//*[@id="main-content"]//a[@href="macro.Macro2.html"]' 'Macro2' | ||
|
||
// @has 'foo/macro.Macro2.html' | ||
// @has - '//*[@class="docblock"]' 'Displayed' | ||
|
||
#[macro_export] | ||
#[doc(hidden)] | ||
macro_rules! foo { | ||
() => {}; | ||
} | ||
|
||
/// not displayed | ||
pub use crate::foo as Macro; | ||
/// Displayed | ||
#[doc(inline)] | ||
pub use crate::foo as Macro2; |