Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proc-macro external type support (#1531) #1600

Merged
merged 1 commit into from
Jun 29, 2023

Commits on Jun 29, 2023

  1. Added suport for using external types in proc-macros

    Moved the FfiConverter implementation for callback interfaces and
    traits from a declarative macro in `uniffi_core` to a proc-macro in
    `uniffi_macros`.  This offers better `UniFfiTag` handling.  Now
    `FfiConverter` is implemented for all tags for callback
    interfaces/traits that are wrapped with the proc-macro attributes. This
    matches the behavior for other types and will help fix mozilla#1531.
    
    Changed the object FfiConverter to be inside a proc-macro, rather than
    using the `Interface` trait.  This more flexibility and avoids
    conflicting impls. For example, this allows for both the objects and
    trait interface `FfiConverters`s to be implemented on `Arc<T>`.  I also
    think it's nicer with less indirection. One drawback is that libraries
    can't implement `FfiConverter` on Arc<T> because of the orphan rules. To
    get around this, I added the `FfiConverterArc` trait.
    
    Other changes:
    - Adding `module_path` to the user type metadata
    - Added an proc-macro -> proc-macro external type test by copying the
      ext-types fixture into another one that uses proc macros.
    bendk committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    f004180 View commit details
    Browse the repository at this point in the history