Public type alias to private or doc(hidden) type only shows impls written in terms of alias
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
Code
mod private {
#[derive(Clone, Copy)]
pub struct Public<T>(T);
}
pub type A<T> = private::Public<Vec<T>>;
impl<T> private::Public<T> { pub fn f() {} }
impl<T> private::Public<Vec<T>> { pub fn g() {} }
impl<T> A<T> {
pub fn h() {}
}
Reproduction Steps
cargo doc --openand observe the documentation forA
Expected Outcome
All of f, g, and h, as well as the implementations of Clone and Copy get shown on the page.
Actual Output
Only the h function is shown in the documentation.
Version
rustdoc 1.95.0-nightly (366a1b93e 2026-02-03)
Additional Details
In my testing, the behavior differs significantly from the rules documented for pub use re-exports, which I initially expected to apply. Ideally, the behavior would be the same between the two, or at least provided similar amounts of control.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the snippet with cargo doc --open and compare the generated documentation for A with the expected methods and trait implementations. Trace rustdoc's handling of public type aliases to private or doc(hidden) types; done means f, g, h, Clone, and Copy are all shown as specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100