Skip to content

rustdoc: Only the last enum variant / struct member is collapsable. #42674

Closed
@kennytm

Description

@kennytm

Test case:

pub enum A {
    /// Long long long
    X,
    /// Long long long
    Y,
    /// Long long long
    Z,
}

pub struct B {
    /// Long long long
    pub x: u32,
    /// Long long long
    pub y: u32,
    /// Long long long
    pub z: u32,
}

Running rustdoc a.rs, it produces these webpages:

screenshot_2017-06-15 20 52 22_vchwyh-fs8

Note that only the last member is collapsible (has a [-]). The global collapse control on the top-right corner can still collapse everything (as a result, you can't independently open X and Y after they are collapsed since the control [+] is missing).

This seems to happen only for 1.19.0+. Same result on Firefox and Chrome.

Real world example:


$ rustdoc -vV
rustdoc 1.19.0-nightly (03abb1bd7 2017-06-13)
binary: rustdoc
commit-hash: 03abb1bd70ac56e4aba0684bab819892a0157843
commit-date: 2017-06-13
host: x86_64-apple-darwin
release: 1.19.0-nightly
LLVM version: 4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    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