Skip to content

UtilsDefaultSerde mismatched types error with yaserde >= 0.8.0 #156

Open
@yheuhtozr

Description

@yheuhtozr

Using xsd-macro-utils with yaserde >= 0.8.0 gives the following error:

162 | #[derive(Default, PartialEq, Debug, UtilsTupleIo, UtilsDefaultSerde)]
    |                                                   ^^^^^^^^^^^^^^^^^
    |                                                   |
    |                                                   expected `&mut Serializer<_>`, found `&mut Serializer<W>`
    |                                                   arguments to this function are incorrect
    |
    = note: `yaserde::ser::Serializer<W>` and `yaserde::ser::Serializer<_>` have similar names, but are actually distinct types
note: `yaserde::ser::Serializer<W>` is defined in crate `yaserde`
   --> ***\.cargo\registry\src\index.crates.io-6f17d22bba15001f\yaserde-0.9.0\src\ser\mod.rs:57:1
    |
57  | pub struct Serializer<W: Write> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `yaserde::ser::Serializer<_>` is defined in crate `yaserde`
   --> ***\.cargo\registry\src\index.crates.io-6f17d22bba15001f\yaserde-0.7.1\src\ser\mod.rs:57:1
    |
57  | pub struct Serializer<W: Write> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `yaserde` are being used?
note: function defined here
   --> ***\.cargo\git\checkouts\xsd-parser-rs-4fe2c72e0cf8e310\7c31c6e\xsd-types\src\utils\yaserde.rs:4:8
    |
4   | pub fn serialize<S, W: Write>(
    |        ^^^^^^^^^
    = note: this error originates in the derive macro `UtilsDefaultSerde` (in Nightly builds, run with -Z macro-backtrace for more info)

I needed to downgrade to the same version (0.7.1) the crate uses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions