lumeohq / xsd-parser-rs

A xsd/wsdl => rust code generator written in rust
Apache License 2.0
100 stars 38 forks source link

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

Open HerrMuellerluedenscheid opened 1 year ago

HerrMuellerluedenscheid commented 1 year ago

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 commented 1 year ago

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