Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly handle inlining of doc hidden foreign items #123459

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

GuillaumeGomez
Copy link
Member

Fixes #123435.

In case a foreign item has doc(hidden) attribute, we simply merged its attributes with the re-export's, making it being removed once in the strip_hidden pass.

The solution was to use the same as for local reexported items: merge attributes, but not some of them (like doc(hidden)).

I originally checked if we could simply update Item::is_doc_hidden method to use self.inline_stmt_id.is_some_and(|def_id| tcx.is_doc_hidden(def_id)) but unfortunately, it added (local) items that shouldn't be inlined. At least it unifies local and foreign items inlining, which I think is the best course of action here.

r? @notriddle

…its attributes

with the re-export's, making it being removed once in the `strip_hidden` pass.

The solution was to use the same as for local reexported items: merge attributes,
but not some of them (like `doc(hidden)`).
@rustbot rustbot 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 Apr 4, 2024
@notriddle
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 11, 2024

📌 Commit 5a0be6f has been approved by notriddle

It is now in the queue for this repository.

@bors bors 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 Apr 11, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 11, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#123459 (Correctly handle inlining of doc hidden foreign items)
 - rust-lang#123740 (Reduce Size of `ModifierInfo`)
 - rust-lang#123770 (Correct broken link in core::pin doc)
 - rust-lang#123777 (Deduplicate some function implementations between the parser and AST/HIR)
 - rust-lang#123808 (codegen tests: Tolerate `nuw` `nsw` on `trunc`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bcdc281 into rust-lang:master Apr 11, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 11, 2024
Rollup merge of rust-lang#123459 - GuillaumeGomez:fix-123435, r=notriddle

Correctly handle inlining of doc hidden foreign items

Fixes rust-lang#123435.

In case a foreign item has doc(hidden) attribute, we simply merged its attributes with the re-export's, making it being removed once in the `strip_hidden` pass.

The solution was to use the same as for local reexported items: merge attributes, but not some of them (like `doc(hidden)`).

I originally checked if we could simply update `Item::is_doc_hidden` method to use `self.inline_stmt_id.is_some_and(|def_id| tcx.is_doc_hidden(def_id))` but unfortunately, it added (local) items that shouldn't be inlined. At least it unifies local and foreign items inlining, which I think is the best course of action here.

r? `@notriddle`
@GuillaumeGomez GuillaumeGomez deleted the fix-123435 branch April 12, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant 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.

[rustdoc] Documentation not being generated for doc(inline)ed re-export of a doc(hidden) item in another crate
4 participants