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

Fix json tuple struct enum variant #88391

Merged
merged 2 commits into from
Aug 31, 2021

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-json Area: Rustdoc JSON backend labels Aug 27, 2021
@GuillaumeGomez GuillaumeGomez changed the title Fix json enum variant Fix json tuple struct enum variant Aug 27, 2021
@rust-log-analyzer

This comment has been minimized.

@camelid camelid added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 27, 2021
@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2021
@GuillaumeGomez
Copy link
Member Author

Updated! I replaced the VariantStruct with a Vec<Item> (because it's needed in a function).

src/librustdoc/passes/stripper.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/print_item.rs Outdated Show resolved Hide resolved
@GuillaumeGomez
Copy link
Member Author

Updated!

@camelid camelid self-assigned this Aug 29, 2021
@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 29, 2021
@@ -56,6 +56,10 @@ crate trait DocFolder: Sized {
|| j.fields.iter().any(|f| f.is_stripped());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Self note (for future):] We can probably remove this part because variant fields always have inherited visibility.

Comment on lines +96 to +97
// Variant fields have inherited visibility
clean::VariantItem(clean::Variant::Struct(..) | clean::Variant::Tuple(..)) => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an unrelated—but still good—fix, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah indeed, didn't even pay attention. But yes, bug fix! :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or actually it shouldn't have any effect on behavior, but it is a performance fix :)

@camelid
Copy link
Member

camelid commented Aug 30, 2021

@bors r=camelid,notriddle

@bors
Copy link
Contributor

bors commented Aug 30, 2021

📌 Commit a521388 has been approved by camelid,notriddle

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 30, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#85017 (Add carrying_add, borrowing_sub, widening_mul, carrying_mul methods to integers)
 - rust-lang#86362 (Avoid cloning LocalDecls)
 - rust-lang#88391 (Fix json tuple struct enum variant )
 - rust-lang#88399 (Disallow the aapcs CC on Aarch64)
 - rust-lang#88418 (Allow `~const` bounds on trait assoc functions)
 - rust-lang#88445 (Clean up the lowering of AST items)
 - rust-lang#88495 (Add `TcpStream::set_linger` and `TcpStream::linger`)
 - rust-lang#88501 (Use right span in prelude collision suggestions with macros. )
 - rust-lang#88504 (Keep turbofish in prelude collision lint.)
 - rust-lang#88524 (Remove unnecessary `mut` from udp doctests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f4f5dd5 into rust-lang:master Aug 31, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 31, 2021
@GuillaumeGomez GuillaumeGomez deleted the fix-json-enum-variant branch August 31, 2021 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo rustdoc -- --output-format json now says a tuple variant is a struct variant
6 participants