-
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 --output-format json command seems broken #25108
Comments
That part about libc isn't weird, because normally when you invoke |
So how am I supposed to test it ? Or just make it work ? |
Do |
It uses rustc and not rustdoc, I'll have to find what the equivalent of |
Never mind, I'm just getting really tired... Here is what I get : > rustdoc src/sysinfo.rs --crate-name sysinfo -o /home/imperio/rust/sysinfo/target/doc -L dependency=/home/imperio/rust/sysinfo/target/debug -L dependency=/home/imperio/rust/sysinfo/target/debug/deps --extern libc=/home/imperio/rust/sysinfo/target/debug/deps/liblibc-9b7976990ae0dbd4.rlib --extern libc=/home/imperio/rust/sysinfo/target/debug/deps/liblibc-9b7976990ae0dbd4.rlib --output-format json
thread '<unnamed>' panicked at 'Rust generated JSON is invalid: SyntaxError(EOFWhileParsingObject, 1, 105198)', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustdoc/lib.rs:525
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Any', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:729 If I'm not wrong, that's the same error... |
Triaging: Still happening on |
I was able to reduce it to this point on the rustdoc. Line 518 in d5ac1a1
The generated json is prematurely ending after opening the
When it tries to parse back, it fails as it is incomplete. I'm not sure if this is hitting a buffer limit for the json generation or there is an issue on implementing the Encodable trait. |
Minimal testcase: use std::collections::HashMap;
extern crate rustc_serialize;
#[derive(Hash, Eq, PartialEq, RustcEncodable, RustcDecodable)]
struct DefId(u32);
fn main() {
let mut coll = HashMap::new();
coll.insert(DefId(0), ());
let json = rustc_serialize::json::as_json(&coll).to_string();
println!("json = {}", json);
} Outputs just |
Encoding |
Oh, that makes sense, only strings are allowed as keys in json. |
(for reference rust-lang#32698) fixes rust-lang#25108 r? @alexcrichton
rustdoc: Remove the json-{input, output} format (for reference #32698) fixes #25108 r? @alexcrichton
I tried this command:
> rustdoc --output-format json src/sysinfo.rs
On this repo.
Result:
So then I added the "missing" feature (that's weird by the way) and then I got:
I guess rustdoc is broken somehow ? Here's my current rustdoc version:
> rustdoc --version rustdoc 1.1.0-nightly (ce1150b9f 2015-05-04) (built 2015-05-04)
The text was updated successfully, but these errors were encountered: