Skip to content

Fix re-export of doc hidden item inside private item not displayed - #112108

Merged
bors merged 2 commits into
rust-lang:masterfrom
GuillaumeGomez:reexport-doc-hidden-private
May 31, 2023
Merged

Fix re-export of doc hidden item inside private item not displayed#112108
bors merged 2 commits into
rust-lang:masterfrom
GuillaumeGomez:reexport-doc-hidden-private

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

This PR fixes this bug:

mod private_module {#[doc(hidden)]pubstructPublic;}pubusecrate::private_module::PublicasFoo;

pub use crate::private_module::Public as Foo; should be visible in the generated doc (and not inlined!) but currently isn't. This PR fixes it.

r? @notriddle

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 30, 2023
Comment threadsrc/librustdoc/visit_ast.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it matter if it's a module or not?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if it's a module, it can contain items that could be re-exported and we need to to go through them too. A good example of this can be seen in tests/rustdoc/infinite-redirection.rs.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment explaining it and moved this matches!() directly into the if condition.

@GuillaumeGomez
GuillaumeGomezforce-pushed the reexport-doc-hidden-private branch from cd4dd39 to 9906504CompareMay 30, 2023 18:28
@GuillaumeGomezGuillaumeGomez changed the title Reexport doc hidden privateFix re-export of doc hidden item inside private item not displayedMay 30, 2023
@notriddle

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 30, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 9906504 has been approved by notriddle

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 30, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 31, 2023
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#112031 (Migrate `item_proc_macro` to Askama)
- rust-lang#112053 (Remove `-Zcgu-partitioning-strategy`.)
- rust-lang#112069 (offset_of: don't require type to be `Sized`)
- rust-lang#112084 (enhancements on build_helper utilization and rustdoc-gui-test)
- rust-lang#112096 (Remove array_zip)
- rust-lang#112108 (Fix re-export of doc hidden item inside private item not displayed)
- rust-lang#112113 (rustdoc: simplify `clean` by removing `FnRetTy`)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 1d643e1 into rust-lang:masterMay 31, 2023
@rustbotrustbot added this to the 1.72.0 milestone May 31, 2023
@GuillaumeGomez
GuillaumeGomez deleted the reexport-doc-hidden-private branch May 31, 2023 10:24
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 15, 2023
…ddle
Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour
Fixesrust-lang#109449.
Fixesrust-lang#53417.
After the discussion in rust-lang#109697, I made a few PRs to fix a few corner cases:
* rust-lang#112178
* rust-lang#112108
* rust-lang#111997
With this I think I covered all cases. Only thing missing at this point was a chapter covering re-exports in the rustdoc book.
r? `@notriddle`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@GuillaumeGomez@notriddle@bors@rustbot