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

Remove Item::kind, use tagged enum. Rename variants to match #82613

Merged
merged 5 commits into from
Mar 8, 2021

Conversation

CraftSpider
Copy link
Contributor

Fixes #82299, by making the ItemEnum tagged. Doesn't remove ItemKind as it's still used in other places.

r? @jyn514
@rustbot label: +A-rustdoc-json +T-rustdoc

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 28, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 28, 2021
@CraftSpider
Copy link
Contributor Author

CC @HeroicKatora

@aDotInTheVoid
Copy link
Member

Can you add a test for this, (probably in rustdoc-json-types, that round trip serilization and deserialization keeps it the same)

Also nit: To be more consistant with clean::types the inner field should be renamed to kind, and the ItemEnum should be renamed to ItemKind (see here)

@CraftSpider
Copy link
Contributor Author

I'll add a test. I'm not sure I like that naming, I think 'kind' is a weird name for the inner values, and we don't really need consistency with clean when it's not harming functionality. Also, ItemKind already exists in JSON, so that name can't be used again.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Mar 5, 2021

I'll add a test. I'm not sure I like that naming, I think 'kind' is a weird name for the inner values, and we don't really need consistency with clean when it's not harming functionality. Also, ItemKind already exists in JSON, so that name can't be used again.

See #80142, I don't think this is worth changing.

@bors

This comment has been minimized.

@jyn514
Copy link
Member

jyn514 commented Mar 6, 2021

@bors delegate=aDotInTheVoid

@bors
Copy link
Contributor

bors commented Mar 6, 2021

✌️ @aDotInTheVoid can now approve this pull request

Copy link
Member

@aDotInTheVoid aDotInTheVoid left a comment

Choose a reason for hiding this comment

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

Mostly good, just a couple of things to do. Also you need to rebase on master

@rustbot modify labels: -S-waiting-on-review +S-waiting-on-author

Cargo.lock Outdated Show resolved Hide resolved
src/librustdoc/json/mod.rs Outdated Show resolved Hide resolved
src/rustdoc-json-types/tests.rs Show resolved Hide resolved
@rustbot rustbot 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 Mar 6, 2021
@aDotInTheVoid
Copy link
Member

@bors r+ squash

@bors
Copy link
Contributor

bors commented Mar 6, 2021

📌 Commit 18841ec has been approved by aDotInTheVoid

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 6, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 8, 2021
Remove Item::kind, use tagged enum. Rename variants to match

Fixes rust-lang#82299, by making the ItemEnum tagged. Doesn't remove ItemKind as it's still used in other places.

r? `@jyn514`
`@rustbot` label: +A-rustdoc-json +T-rustdoc
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 8, 2021
Remove Item::kind, use tagged enum. Rename variants to match

Fixes rust-lang#82299, by making the ItemEnum tagged. Doesn't remove ItemKind as it's still used in other places.

r? ``@jyn514``
``@rustbot`` label: +A-rustdoc-json +T-rustdoc
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 8, 2021
Remove Item::kind, use tagged enum. Rename variants to match

Fixes rust-lang#82299, by making the ItemEnum tagged. Doesn't remove ItemKind as it's still used in other places.

r? ```@jyn514```
```@rustbot``` label: +A-rustdoc-json +T-rustdoc
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 8, 2021
Remove Item::kind, use tagged enum. Rename variants to match

Fixes rust-lang#82299, by making the ItemEnum tagged. Doesn't remove ItemKind as it's still used in other places.

r? ````@jyn514````
````@rustbot```` label: +A-rustdoc-json +T-rustdoc
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 8, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#82047 (bypass auto_da_alloc for metadata files)
 - rust-lang#82415 (expand: Refactor module loading)
 - rust-lang#82557 (Add natvis for Result, NonNull, CString, CStr, and Cow)
 - rust-lang#82613 (Remove Item::kind, use tagged enum. Rename variants to match)
 - rust-lang#82642 (Fix jemalloc usage on OSX)
 - rust-lang#82682 (Implement built-in attribute macro `#[cfg_eval]` + some refactoring)
 - rust-lang#82684 (Disable destination propagation on all mir-opt-levels)
 - rust-lang#82755 (Refactor confirm_builtin_call, remove partial if)
 - rust-lang#82857 (Edit ructc_ast_lowering docs)
 - rust-lang#82862 (Generalize Write impl for Vec<u8> to Vec<u8, A>)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0681951 into rust-lang:master Mar 8, 2021
@CraftSpider CraftSpider deleted the fix-de branch February 23, 2022 15:53
@cuviper cuviper added this to the 1.52.0 milestone Nov 16, 2023
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.

Rustdoc Json: structs and functions deserialize incorrect
8 participants