Skip to content
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

UtilsDefaultSerde mismatched types error with yaserde >= 0.8.0 #156

Open
yheuhtozr opened this issue Dec 30, 2023 · 0 comments
Open

UtilsDefaultSerde mismatched types error with yaserde >= 0.8.0 #156

yheuhtozr opened this issue Dec 30, 2023 · 0 comments

Comments

@yheuhtozr
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant