chinedufn / swift-bridge

swift-bridge facilitates Rust and Swift interop.
https://chinedufn.github.io/swift-bridge
Apache License 2.0
842 stars 62 forks source link

Improve the error message in SharedStructDeclarationParser when an un… #244

Closed bes closed 1 year ago

bes commented 1 year ago

…supported attribute is found

The panic message now contains the name of the unsupported attribute as well as the name of the struct that the attribute was found on.

This commit also updates the documentation to fix faulty struct attributes.

bes commented 1 year ago

I just got bit by this yesterday, when upgrading swift-bridge from 0.1.49 to latest.

I had used #[swift_bridge::bridge(swift_repr = "struct")] on a struct, but that syntax is unsupported.

The correct syntax is #[swift_bridge(swift_repr = "struct")].

chinedufn commented 1 year ago

Thanks!