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

Compilation failure: field must implement Copy or be wrapped in ManuallyDrop<...> to be used in a union #67

Open
kihehs opened this issue Feb 2, 2024 · 1 comment

Comments

@kihehs
Copy link

kihehs commented Feb 2, 2024

Unfortunately the crate doesn't compile anymore:

error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
   --> /.../debug/build/tflite-b6694d55739fc4de/out/tflite_types.rs:450:13
    |
450 |             pub _M_val: _Tp,
    |             ^^^^^^^^^^^^^^^
    |
    = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
    |
450 |             pub _M_val: std::mem::ManuallyDrop<_Tp>,
    |                         +++++++++++++++++++++++   +

For more information about this error, try `rustc --explain E0740`.
error: could not compile `tflite` (lib) due to 1 previous error
  • Rust version: 1.75.0
  • Crate version: 0.9.7
  • OS: Ubuntu 22.04

I'm happy to provide more details if needed.

@kihehs kihehs changed the title Compilation failure: Compilation failure: field must implement Copy or be wrapped in ManuallyDrop<...> to be used in a union Feb 2, 2024
@boncheolgu
Copy link
Owner

This is a bug of bindgen. rust-lang/rust-bindgen#2764 fixes it.
Which version of clang and gcc do you use?

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

2 participants