0.1.56
-
Add
swift-bridge parse-bridges
CLI command. #274 (thanks @integer-overflown)swift-bridge-cli parse-bridges --crate-name my-crate -f src/lib.rs -o generated
swift-bridge-cli parse-bridges --crate-name my-superb-crate \ -f src/lib.rs \ -f src/some_other_file.rs \ -o generated
-
Respect bridge modules' visibility. #284 (thanks @jnbooth)
// Notice that this is `pub mod`. // Before this commit `swift-bridge` would ignore the `pub` and instead // emit a `mod ffi`. // This made it impossible to `use enums::ffi_foo::MyEnum` from another module. #[swift_bridge::bridge] pub mod ffi_foo { enum MyEnum { VariantA, VariantB, VariantC, } } #[swift_bridge::bridge] pub(crate) mod ffi_bar { enum AnotherEnum { Variant1, Variant2, } }
-
Add a temporary work around for a dead code linting regression in Rust
1.79
. #278 (thanks @sax)rustc
's dead code linting pass regressed in1.79
, causingswift-bridge
to sometimes generate code that emitted dead code warnings, even though the code was not dead.- tracked: rust-lang/rust#126706
// Some bridge modules that used `Result` were given an // "error: field `0` is never read" warning. #[swift_bridge::bridge] mod ffi { #[swift_bridge(swift_repr = "struct")] struct TransparentErrorStruct(pub String); extern "Rust" { fn rust_func_returns_result_transparent_struct( succeed: bool ) -> Result<(), TransparentErrorStruct>; } }