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

YaSerialize: doesnt have a size known at compile-time #145

Open
HerrMuellerluedenscheid opened this issue Feb 27, 2023 · 1 comment
Open

Comments

@HerrMuellerluedenscheid

I generated rust code based on this xsd: https://www.fdsn.org/xml/station/fdsn-station-1.1.xsd

I had to modify it a little to make it work and comment out some restrictions but that is stuff for another issue I guess.

I tried loading an example file with the generated code and got a lot of these issues:

error[E0277]: the size for values of type `str` cannot be known at compilation time
    --> src/stationxml.rs:1372:37
     |
1372 | #[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
     |                                     ^^^^^^^^^^^ doesn't have a size known at compile-time
     |
     = help: the trait `Sized` is not implemented for `str`
     = note: all local variables must have a statically known size
     = help: unsized locals are gated as an unstable feature
     = note: this error originates in the derive macro `YaSerialize` (in Nightly builds, run with -Z macro-backtrace for more info)

I have yaserde_derive in my Cargo.toml and use yaserde_derive::{YaDeserialize, YaSerialize};.

Any hints what I might be doing wrong? Version issue?

Best

@HerrMuellerluedenscheid
Copy link
Author

Also I get this errors which I dont understand because xs::DateTime is the type. I'm uncertain why the compiler fails to infer the type if it is there.

1376 |     pub start: xs::DateTime,
     |     ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type

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