-
Notifications
You must be signed in to change notification settings - Fork 13k
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(bootstrap): deserialize null as f64::NAN
#136034
Conversation
When doing optimized build through opt-dist, I've often run into errors like `invalid type: null, expected f64`. This is likely because some f64 fields might actually bet set null. Unfortunately, serde_json doesn't handle null <-> NaN well. This commit addresses it by having a custom deserialize method, so null is always be deserialized to `f64:NAN`. See: * https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/opt-dist.3A.20.60invalid.20type.3A.20null.2C.20expect.20f64.60.20failure * serde-rs/json#202
Could not assign reviewer from: |
rustbot has assigned @Mark-Simulacrum. Use |
I thought JSON was supposed to support NaN literals? |
huh, won't go into my browser's JSON.parse. Guess not. |
|
It's so incredibly funny that serde_json can't roundtrip @bors r+ rollup |
|
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#135971 (Properly report error when object type param default references self) - rust-lang#135977 (Fix `FormattingOptions` instantiation with `Default`) - rust-lang#135985 (Rename test to `unresolvable-upvar-issue-87987.rs` and add some notes) - rust-lang#135991 (Fix set_name in thread mod for NuttX) - rust-lang#136009 (bootstrap: Handle bootstrap lockfile race condition better) - rust-lang#136018 (Use short ty string for move errors) - rust-lang#136027 (Skip suggestions in `derive`d code) - rust-lang#136029 (Bootstrap: Don't move ownership of job object) - rust-lang#136034 (fix(bootstrap): deserialize null as `f64::NAN`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136034 - weihanglo:null-as-f64-nan, r=compiler-errors fix(bootstrap): deserialize null as `f64::NAN` When doing optimized build through opt-dist, I've often run into errors like `invalid type: null, expected f64`. This is likely because some f64 fields might actually bet set null. Unfortunately, serde_json doesn't handle null <-> NaN well. This commit addresses it by having a custom deserialize method, so null is always be deserialized to `f64:NAN`. See: * https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/opt-dist.3A.20.60invalid.20type.3A.20null.2C.20expect.20f64.60.20failure * serde-rs/json#202 r? `@Kobzol`
When doing optimized build through opt-dist,
I've often run into errors like
invalid type: null, expected f64
.This is likely because some f64 fields might actually bet set null.
Unfortunately, serde_json doesn't handle null <-> NaN well.
This commit addresses it by having a custom deserialize method, so null is always be deserialized to
f64:NAN
.See:
r? @Kobzol