Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Remove all the PartialEq<Value> impls for standard library types #140

Closed
dtolnay opened this issue Oct 4, 2019 · 1 comment · Fixed by #282
Closed

Remove all the PartialEq<Value> impls for standard library types #140

dtolnay opened this issue Oct 4, 2019 · 1 comment · Fixed by #282

Comments

@dtolnay
Copy link
Owner

dtolnay commented Oct 4, 2019

Currently we have:

  • impl PartialEq<Value> for str
  • impl PartialEq<Value> for &str
  • impl PartialEq<Value> for String
  • impl PartialEq<Value> for i8
  • impl PartialEq<Value> for i16
  • impl PartialEq<Value> for i32
  • impl PartialEq<Value> for i64
  • impl PartialEq<Value> for isize
  • impl PartialEq<Value> for u8
  • impl PartialEq<Value> for u16
  • impl PartialEq<Value> for u32
  • impl PartialEq<Value> for u64
  • impl PartialEq<Value> for usize
  • impl PartialEq<Value> for f32
  • impl PartialEq<Value> for f64

These potentially lead to surprising inference errors in code that is unrelated to Serde: serde-rs/json#357, rust-lang/rust#46257

@ejpcmac
Copy link

ejpcmac commented Jul 24, 2021

Hello @dtolnay, I’ve come across some very strange type inference issues after adding a completely unrelated dependency to one of my projects, and just narrowed it down to serde_yaml. I have a minimal working example if it is helpful.

P.S. : The tricky thing was I did not add serde_yaml to my project, but probe-rs-rtt, which is using serde_yaml under the hood.

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

Successfully merging a pull request may close this issue.

2 participants