Skip to content

0.1.43

Compare
Choose a tag to compare
@chinedufn chinedufn released this 15 Dec 17:29
· 115 commits to master since this release
d921eec
  • Show a spanned compile time error for invalid module items. #124

    #[swift_bridge::bridge]
    mod ffi {
        use std;
        fn foo() {}
    }
    
    // error: Only `extern` blocks, structs and enums are supported.
    //  --> tests/ui/invalid-module-item.rs:6:5
    //   |
    // 3 |     use std;
    //   |     ^^^^^^^^
    //
    // error: Only `extern` blocks, structs and enums are supported.
    //  --> tests/ui/invalid-module-item.rs:7:5
    //   |
    // 4 |     fn foo() {}
    //   |     ^^^^^^^^^^^
  • Allow enums to use the #[already_declared] attribute. #125

     // For example, the following is now possible:
    
     use some_other_bridge_module::SomeEnum;
     
     #[swift_bridge::bridge]
     mod ffi {
         #[swift_bridge(already_declared)]
         enum SomeEnum {}
     
         extern "Rust" {
             fn print(val: SomeEnum);
         }
     }