-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: generate JSON via serde #61028
Conversation
@@ -34,15 +34,12 @@ extern crate rustc_interface; | |||
extern crate rustc_metadata; | |||
extern crate rustc_target; | |||
extern crate rustc_typeck; | |||
extern crate serialize; | |||
extern crate syntax; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm; unrelatedly to this PR, these extern crate
s seem unfortunate; would be good to get rid of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't they necessary since they're being loaded from the sysroot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly... I'm not familiar with how rustdoc operates. =P One could try to remove them and see what happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it loads all the rustc crates from the sysroot, not via --extern
flags. Does rust 2018 allow you to implicitly load in sysroot crates?
@@ -2524,7 +2523,6 @@ pub enum TypeKind { | |||
Struct, | |||
Union, | |||
Trait, | |||
Variant, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this "some variants that cannot be constructed"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this and Type::Unique
triggered the dead code lint.
@@ -879,7 +889,7 @@ function handleThemeButtonsBlur(e) {{ | |||
|
|||
themePicker.onclick = switchThemeButtonState; | |||
themePicker.onblur = handleThemeButtonsBlur; | |||
[{}].forEach(function(item) {{ | |||
{}.forEach(function(item) {{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took me a while to understand this change haha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a diff of the generated JS files to be sure we have exactly what's expected?
.collect::<Vec<String>>() | ||
.join(",")).as_bytes(), | ||
)?; | ||
serde_json::to_string(&themes).unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it generate the same thing? Also, please replace unwrap
with expect
.
☔ The latest upstream changes (presumably #61343) made this pull request unmergeable. Please resolve the merge conflicts. |
Note to triage: I intend to return to this in the next week. |
Differences in |
☔ The latest upstream changes (presumably #62041) made this pull request unmergeable. Please resolve the merge conflicts. |
I am going to close this for now as I have just started a new job and I'm not sure what my schedule will be like the next few weeks. Hopefully I'll be able to resubmit this incrementally. |
replace serialize with serde in rustdoc This is a slightly less aggressive version of #61028. r? @GuillaumeGomez
This PR replaces all usage of
libserialize
in rustdoc withserde
andserde_json
.It also removes all derivations of
RustcEncodable
andRustcDecodable
, which appear to be unused. This revealed some variants that cannot be constructed, so I removed those as well.