Skip to content

Deserializing fails for JSON generated by rustdoc 1.70 #23

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

Closed
GoldsteinE opened this issue Jun 19, 2023 · 5 comments
Closed

Deserializing fails for JSON generated by rustdoc 1.70 #23

GoldsteinE opened this issue Jun 19, 2023 · 5 comments

Comments

@GoldsteinE
Copy link

Repro:

pub struct Foo;

impl Foo {
    pub fn bar(&self) {
        println!("test");
    }
}

Error:

unknown variant `decl`, expected one of `module`, `extern_crate`, `import`, `union`, `struct`, `struct_field`, `enum`, `variant`, `function`, `trait`, `trait_alias`, `impl`, `typedef`, `opaque_ty`, `constant`, `static`, `foreign_type`, `macro`, `proc_macro`, `primitive`, `assoc_const`, `assoc_type` at line 1 column 616
@Enselic
Copy link
Member

Enselic commented Jun 19, 2023

Please provide detailed information about what versions you use for everything, as well as full commands and source code you use to reproduce the problem. In my own project I run extensive rustdoc-json deserialization tests each night with the latest Rust nightly toolchain, and I have not detected any issues.

@aDotInTheVoid
Copy link
Member

rustdoc 1.70 won't give json output, as it's not stable (unless your using unspeakable env-var hacks, which arn't supported)

What version of the rustdoc-types crate are you using?

What is the format_version of the json produced?

@GoldsteinE
Copy link
Author

GoldsteinE commented Jun 19, 2023

Versions that I’ve tried:

  1. rustdoc 1.70.0-nightly (9df3a39fb 2023-04-11)
  2. rustdoc 1.70.0 stable + RUSTC_BOOTSTRAP hack

.format_version is 24 in both cases.

I realize now that the latest version of rustdoc-types is probably meant for a different nightly.

@aDotInTheVoid
Copy link
Member

aDotInTheVoid commented Jun 19, 2023

Yeah see CHANGELOG.md, for format version 24, you want `rustdoc-types="0.20.0".

(At some point we should syncronize FORMAT_VERSION and the version on crates.io)

@GoldsteinE
Copy link
Author

Thanks for helping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants