Skip to content

Conversation

@dtolnay
Copy link
Owner

@dtolnay dtolnay commented Dec 18, 2020

Relevant to dtolnay/cxx#290.

Currently:

    warning: `extern` fn uses type `anyhow::Error`, which is not FFI-safe
     --> tests/test_ffi.rs:6:32
      |
    6 | pub extern "C" fn anyhow1(err: anyhow::Error) {
      |                                ^^^^^^^^^^^^^ not FFI-safe
      |
    note: the lint level is defined here
     --> tests/test_ffi.rs:1:26
      |
    1 | #![warn(improper_ctypes, improper_ctypes_definitions)]
      |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
      = note: this struct has unspecified layout

    warning: `extern` fn uses type `Option<anyhow::Error>`, which is not FFI-safe
      --> tests/test_ffi.rs:16:32
       |
    16 | pub extern "C" fn anyhow3() -> Option<anyhow::Error> {
       |                                ^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
       |
       = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
       = note: enum has no representation hint
@dtolnay dtolnay merged commit 1e70b58 into master Dec 18, 2020
@dtolnay dtolnay deleted the repr branch December 18, 2020 20:29
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

Successfully merging this pull request may close these issues.

2 participants