-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Hi,
while trying to derive structs from some xsd I experienced a panic in the derive macro with an unhelpful message:
error: proc-macro derive panicked
--> src/main.rs:16:17
|
16 | #[derive(Debug, XmlSchema)]
| ^^^^^^^^^
|
= help: message: called `Option::unwrap()` on a `None` value
I tracked down the problem in the handling of anyType
.
This is the minimal reproducible xsd that I could come up with:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="mixedType">
<complexContent>
<restriction base="anyType"></restriction>
</complexContent>
</complexType>
</schema>
The panick is triggered by this unwrap: https://github.com/media-io/xml-schema/blob/a6a5b5800403d840e0d76eb6cd195c6854b1928d/xml_schema_derive/src/xsd/complex_content.rs#L19
Metadata
Metadata
Assignees
Labels
No labels