Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustdoc: impl block with only associated constants not collapsible #71822

Closed
tspiteri opened this issue May 3, 2020 · 5 comments · Fixed by #71842
Closed

Rustdoc: impl block with only associated constants not collapsible #71822

tspiteri opened this issue May 3, 2020 · 5 comments · Fixed by #71842
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tspiteri
Copy link
Contributor

tspiteri commented May 3, 2020

pub struct S;
impl S {
    pub const C: () = ();
}
impl S {
    pub fn foo() {}
}

The first impl block with a constant is not collapsible like the second impl block with a function.

methods

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 3, 2020
@GuillaumeGomez
Copy link
Member

As far as I can tell, this is the desired behaviour (not to hide associated impl constant). So unless I'm missing something, there is nothing to fix here?

cc @rust-lang/rustdoc

@tspiteri
Copy link
Contributor Author

tspiteri commented May 4, 2020

Why are they not hidden? It felt surprising to me, as they are part of the impl block. Also because if an impl block contains both constants and methods, both the constants and the methods are hidden when the impl block is collapsed (and this I expected).

@tspiteri
Copy link
Contributor Author

tspiteri commented May 4, 2020

For example impl i32 contains constants, and it is collapsible, with both the constants and the methods hidden on collapse.

@GuillaumeGomez
Copy link
Member

It seems weird to me as well but I wasn't the one enforcing it and I don't remember the reason. Let's wait to hear from @rust-lang/rustdoc first.

@kinnison
Copy link
Contributor

kinnison commented May 8, 2020

It seems odd to me that they're not treated equivalently.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 8, 2020
…eGomez

doc: make impl block collapsible if it has an associated constant

Fixes rust-lang#71822.
@bors bors closed this as completed in da18df2 Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants