-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Open
Copy link
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
With PR #124939, rustdoc hides in the "Aliased type" section of type alias every type that is not from the current crate.
However if we had access in rustdoc to the Cargo workspace information we could instead be more fine-grain and not hide those coming from the same workspace.
Crate A:
pub struct One<T>(T);
Crate B:
pub type OneString = One<String>;
If crate A and B are in the same workspace we should probably not hide the inner item, and therefor display:
// in Aliased Type
struct OneString(String)
// instead of
struct OneString(/* private items */)
@rustbot labels +T-rustdoc +A-rustdoc-ui +C-discussion
Metadata
Metadata
Assignees
Labels
A-rustdoc-uiArea: Rustdoc UI (generated HTML)Area: Rustdoc UI (generated HTML)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Nemo157 commentedon May 13, 2024
Rather than rustdoc gaining workspace knowledge, another approach would be for cargo to pass a flag when building the in-workspace
rmeta
s saying that they should have private details exposed. Then rustdoc could see this from the metadata when it's generating docs involving an external type. That leaves the policy of when to expose private details up to the build system, and you could imagine something like a--document-all-private-items
flag for cargo that applies it to all dependencies, or applying it to non-workspace path dependencies as well.