rust-lang / rust-lang/rust

Rustdoc "Auto Trait Implementations" is showing private types instead of the relevant generic bounds

Open
#162,274 3 comments 0 reactions 1 assignee View on GitHub

@fmease is already working on this.

Since Sep 4, 2026.

A-auto-traits A-synthetic-impls C-bug regression-from-stable-to-nightly requires-nightly T-rustdoc WG-trait-system-refactor
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

pub struct Foo<T>(Bar<T>);

struct Bar<T>(Box<T>);

Or, see a standard library type such as Vec.

Reproduction Steps

  1. cargo doc --open
  2. Visit the "Auto Traits" section of Foo

OR

  1. https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#synthetic-implementations

Expected Outcome

Auto trait implementations should, as they do on stable, show their bounds in terms of the generics of the type.

impl<T> Send for Foo<T>
where
    T: Send,
impl<T, A> Send for Vec<T, A>
where
    A: Send,
    T: Send,

Actual Output

impl<T> Send for Foo<T>
where
    Bar<T>: Send,

Bar is a private type and should not appear in the documentation.

impl<T, A> Send for Vec<T, A>
where
    RawVec<T, A>: Send,

RawVec is a private type and should not appear in the documentation.

This prevents users from understanding what the actual bounds on the impl are, because Bar and RawVec may have bounds that are not the obvious ones.

Version

rustdoc 1.100.0-nightly (2e2b193f8 2026-09-02)

Does not reproduce on 1.98.0 or 1.99.0-beta.3 (cbae9b4ca 2026-08-28)

Additional Details

@rustbot label regression-from-stable-to-nightly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.