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

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

Open
godzie44 opened this issue May 24, 2024 · 0 comments
Open

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

godzie44 opened this issue May 24, 2024 · 0 comments

Comments

@godzie44
Copy link

godzie44 commented May 24, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant