Skip to content

extern block uses type NotCopyNotClone, which is not FFI-safe #114

@godzie44

Description

@godzie44

Hi, i'm trying to implement sdk for my plugin system. In an application side i'm define a function:

#[sabi_extern_fn]
pub fn info_version() -> RString {
    VersionInfo::current().to_string().into()
}

In a plugin side i'm trying to use it like:

extern "C" {
    fn info_version() -> RString;
}

There is warnings when compiling with rustc 1.78.0:

warning: `extern` block uses type `NotCopyNotClone`, which is not FFI-safe
 --> sdk/info.rs:4:26
  |
4 |     fn info_version() -> RString;
  |                          ^^^^^^^ not FFI-safe
  |
  = help: consider adding a member to this struct
  = note: this struct has no fields
  = note: `#[warn(improper_ctypes)]` on by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions