Trait implementation among incompatible version but within same path results in confusing error

I have pulled serde-xml@=0.9.1, which depends on serde@^0.8. But it will solved as serde@=0.8.23 which (probably) is not considered as compatible with serde@^1.0 (modern releases).

Here is minimized example.

However, I was confused with not so good error:

log
   Compiling serde v1.0.188
    Checking log v0.4.20
    Checking serde v0.8.23
    Checking log v0.3.9
    Checking serde_xml v0.9.1
    Checking incompatible-trait-error v0.1.0 (/home/kisaragi/IdeaProjects/incompatible-trait-error)
error[E0277]: the trait bound `Foo: serde::de::Deserialize` is not satisfied
   --> src/main.rs:4:38
    |
4   |     assert_eq!(serde_xml::from_str::<Foo>("<x>12345</x>").unwrap().x, 12345);
    |                                      ^^^ the trait `serde::de::Deserialize` is not implemented for `Foo`
    |
    = help: the following other types implement trait `serde::de::Deserialize`:
              bool
              char
              isize
              i8
              i16
              i32
              i64
              usize
            and 85 others
note: required by a bound in `serde_xml::from_str`
   --> /home/kisaragi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_xml-0.9.1/src/de/mod.rs:887:14
    |
886 | pub fn from_str<T>(s: &str) -> Result<T, Error>
    |        -------- required by a bound in this function
887 |     where T: de::Deserialize,
    |              ^^^^^^^^^^^^^^^ required by this bound in `from_str`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `incompatible-trait-error` (bin "incompatible-trait-error") due to previous error

I have found prior topic and issue, but they're not so active.

I have avoided this issue with serde-xml-rs, but is there any progress around there?

The issue you linked is where any updates would be.

This topic was automatically closed 540 days after the last reply. New replies are no longer allowed.