Skip to content

rustdoc: Trait implementations aren't listed in generated docs under some circumstances #36922

Description

@jimmycuadra

Serde's Deserialize and Serialize traits don't show up in the "Trait Implementations" section for types that use custom derive through Macros 1.1 or through Syntex. Alex Crichton also notes that rustdoc does not display Copy in the "Trait Implementations" section with the following code:

#[derive(Clone)]           
pub struct Point {         
    x: i32,                
    y: i32,                
}                          

const _FOO: () = {         
    impl Copy for Point {} 
    ()                     
};

I've only tested this on nightly Rust.

Activity

  1. eddyb commented on Oct 3, 2016

    @eddyb
    Contributor

    @alexcrichton Ugh, the way rustdoc scans a crate is dubious at best. I've been having to patch up rustdoc for various typesystem/metadata changes, and it's really sad how items from extern crates are second-class, but at the same time you have bugs like these because the local crate visit is simplistic.

    What's needed is a rustdoc rewrite that does as little as possible, working mostly with non-syntactical information and recovering the minimum required - relying too much on syntax can leak confusing context.
    And it really shouldn't have two ASTs of its own. I know @cmr was frustrated with libsyntax but rustdoc is barely maintainable right now.

  2. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Oct 3, 2016
  3. alexcrichton commented on Oct 3, 2016

    @alexcrichton
    Member

    @eddyb I think rustdoc's slogan is "dubious at best"

  4. TyOverby commented on Mar 27, 2017

    @TyOverby
    Contributor

    This bug is particularly confusing for crates that use Serde. Right now auto-derived implementations of Serialize/Deserialize don't show up in rustdoc.

  5. added
    T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.
    and removed on May 18, 2017
  6. shepmaster commented on Jul 4, 2018

    @shepmaster
    Member

    Whew! This is super confusing!

  7. QuietMisdreavus commented on Aug 7, 2018

    @QuietMisdreavus
    Contributor

    I've opened #53162 to fix this.

  8. added a commit that references this issue on Sep 7, 2018
  9. added 2 commits that reference this issue on Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions