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 rendered consts should respect #[doc(hidden)] fields #49259

Closed
SergioBenitez opened this issue Mar 22, 2018 · 2 comments
Closed

rustdoc rendered consts should respect #[doc(hidden)] fields #49259

SergioBenitez opened this issue Mar 22, 2018 · 2 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@SergioBenitez
Copy link
Contributor

For a struct and const declared as:

pub struct HiddenFoo {
    #[doc(hidden)]
    pub foo: usize,
}

pub const SOME_FOO: HiddenFoo = HiddenFoo { foo: 10 };

rustdoc currently renders:

pub const SOME_FOO: HiddenFoo

SOME_FOO: HiddenFoo = HiddenFoo { foo: 10 };

This unhides the hidden foo field. Instead, it should respect the #[doc(hidden)] attribute on foo and render the following:

pub const SOME_FOO: HiddenFoo

SOME_FOO: HiddenFoo = HiddenFoo { .. };

Or, better yet, if all fields are hidden, then I'd prefer for it to not render the definition at all:

pub const SOME_FOO: HiddenFoo

@GuillaumeGomez GuillaumeGomez self-assigned this Mar 23, 2018
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 23, 2018
@GuillaumeGomez
Copy link
Member

Seems complicated since at the point we print it, we don't have fields declaration attributes anymore...

@GuillaumeGomez GuillaumeGomez removed their assignment Mar 26, 2018
@jkordish jkordish added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools-rustdoc labels Apr 25, 2018
@ollie27
Copy link
Member

ollie27 commented Nov 22, 2019

Fixed by #53409. We don't show the values of consts anymore.

@ollie27 ollie27 closed this as completed Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants