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 displays "pub" to struct-like enum variants and their fields #32395

Closed
nodakai opened this issue Mar 21, 2016 · 1 comment · Fixed by #32423
Closed

rustdoc displays "pub" to struct-like enum variants and their fields #32395

nodakai opened this issue Mar 21, 2016 · 1 comment · Fixed by #32423
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@nodakai
Copy link
Contributor

nodakai commented Mar 21, 2016

pub enum RangeInclusive<Idx> {
    pub Empty {
        pub at: Idx,
    },
    pub NonEmpty {
        pub start: Idx,
        pub end: Idx,
    },
}

This is no longer valid Rust: https://doc.rust-lang.org/error-index.html#E0449

Incidentally, tuple-like enum variants seems to be free from this issue:

pub enum Component<'a> {
    Prefix(PrefixComponent<'a>),
    RootDir,
    CurDir,
    ParentDir,
    Normal(&'a OsStr),
}
@sfackler
Copy link
Member

It looks like this only happens for enums reexported across crates. The libcore version of RangeInclusive is rendered correctly: https://doc.rust-lang.org/nightly/core/ops/enum.RangeInclusive.html

@sfackler sfackler added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 21, 2016
eddyb added a commit to eddyb/rust that referenced this issue Mar 23, 2016
…ichton

rustdoc: Omit `pub` for inlined variant-struct fields

fixes rust-lang#32395

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants