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

Unsupported element type of Vec<[u64; 3]> #1354

Open
chris838 opened this issue Jun 13, 2024 · 0 comments
Open

Unsupported element type of Vec<[u64; 3]> #1354

chris838 opened this issue Jun 13, 2024 · 0 comments

Comments

@chris838
Copy link

It seems like cxx rejects Vec<[u64; 3]> as a supported type, though Vec<T> and [T; N] are both supported individually.

Steps to reproduce:

// main.rs
include!("include/foo.h");
#[cxx::bridge]
pub mod ffi {

    unsafe extern "C++" {
        fn foo(x: Vec<[u64; 3]>);
    }
}
// foo.h
void foo(rust::Vec<std::array<uint64_t, 3>> x);

Produces the following error:

  error[cxxbridge]: unsupported element type of Vec
     ┌─ src/main.rs:17:19
     │
  17 │         fn foo(x: Vec<[u64; 3]>);
     │                   ^^^^^^^^^^^^^ unsupported element type of Vec

Referenced from this SA question:
https://stackoverflow.com/questions/78616935/binding-rust-vect-n-to-c-using-cxx?noredirect=1#comment138602956_78616935

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