Skip to content

Rustdoc: strange collapse behaviour when impl block has comment #71849

Closed
@tspiteri

Description

@tspiteri
pub struct S;
impl S {
    pub const C1: () = ();
    pub fn foo1() {}
}
/// Comment
impl S {
    pub const C2: () = ();
    pub fn foo2() {}
}
/// Comment
impl S {
    pub const C3: () = ();
    pub fn foo3() {}
}

On the left of the image is the documentation for the three blocks.

  1. No comment for the impl block.
  2. The comment for the impl block is expanded.
  3. The comment for the impl block is collapsed.

On the right, there is what happens when the three impl blocks are collapsed.

  1. Collapsed as expected, with both constant and function hidden as expected.
  2. The comment is still visible though its [-] is hidden. The function is hidden as expected but the constant is not hidden.
  3. The comment is hidden as expected. The function is hidden as expected but the constant is not hidden.

collapse

Metadata

Metadata

Labels

A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.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