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: Tuple structs with no fields are marked as having private fields #118180

Closed
Kyuuhachi opened this issue Nov 22, 2023 · 2 comments · Fixed by #118192
Closed

rustdoc: Tuple structs with no fields are marked as having private fields #118180

Kyuuhachi opened this issue Nov 22, 2023 · 2 comments · Fixed by #118192
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Kyuuhachi
Copy link
Contributor

I tried this code:

pub struct MyStruct();
pub enum MyEnum {
    A(),
    B(u8),
}

I would expect this to be documented as-is: as tuple structs/variants with no fields. But instead, rustdoc marks them as having private fields:

pub struct MyStruct(/* private fields */);
pub enum MyEnum {
    A(/* private fields */),
    B(u8),
}

Enums can't even have private fields!

Named structs/variants do not have this issue.

Meta

rustdoc --version --verbose:

rustdoc 1.76.0-nightly (2f8d81f9d 2023-11-21)
binary: rustdoc
commit-hash: 2f8d81f9dbac6b8df982199f69da04a4c8357227
commit-date: 2023-11-21
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5
@Kyuuhachi Kyuuhachi added the C-bug Category: This is a bug. label Nov 22, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 22, 2023
@fmease fmease added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 22, 2023
@compiler-errors
Copy link
Member

Probably has to do with an .all call treating a list of 0 elements as vacuously true. Should be an easy fix.

@compiler-errors compiler-errors added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Nov 22, 2023
@Kyuuhachi
Copy link
Contributor Author

Guess I'll try fixing it myself, then. Might be a good way to familiarize myself with the test system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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