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

Documentation of associated constants #94652

Closed
DJDuque opened this issue Mar 5, 2022 · 2 comments · Fixed by #95316
Closed

Documentation of associated constants #94652

DJDuque opened this issue Mar 5, 2022 · 2 comments · Fixed by #95316
Assignees
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

@DJDuque
Copy link

DJDuque commented Mar 5, 2022

Maybe this is not a bug, but I was expecting the documentation of associated constants to work in the same way as it does for functions.

I tried this code:

pub trait MyConstants {
    const A: usize;
    const B: usize;
    const TOTAL: usize = Self::A + Self::B;
}

I was expecting the documentation to show e.g. A and B as required, and then TOTAL would just be auto generated. Same way as it happens with functions of a trait.

In practice it does work like that. I can implement only A and B, and then TOTAL will be auto implemented. The problem is that the documentation is not generated in a way that shows this, it simply looks as if all 3 constants are needed.

@DJDuque DJDuque added the C-bug Category: This is a bug. label Mar 5, 2022
@DJDuque
Copy link
Author

DJDuque commented Mar 5, 2022

@rustbot modify labels: +T-rustdoc

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 5, 2022
@fmease
Copy link
Member

fmease commented Mar 22, 2022

@rustbot claim

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.

3 participants