Skip to content

Rust 2024: uniffi_reexport_scaffolding: usage of unsafe attribute #2459

@bes

Description

@bes

I am trying to migrate a large project to Rust 2024, but I'm running into a small SNAFU.

I have two crates exporting uniffi types: A main crate and a helper crate with models. When trying to use the uniffi_reexport_scaffolding macro I get the following error:

error: unsafe attribute used without unsafe
  --> src/lib.rs:14:1
   |
14 | models::uniffi_reexport_scaffolding!();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
   |
   = note: this error originates in the macro `models::uniffi_reexport_scaffolding` (in Nightly builds, run with -Z macro-backtrace for more info)
help: wrap the attribute in `unsafe(...)`
  --> models/src/lib.rs:5:3
   |
5  | ununsafe(iffi::setup_scaffolding!("models"));
   |   +++++++                                 +

(note the nonsensical placement of unsafe recommended by rust on the second to last line)

Any ideas / recommendations? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions