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

Can't compile with newer versions of Rust #58

Open
sheosi opened this issue Jul 2, 2022 · 5 comments
Open

Can't compile with newer versions of Rust #58

sheosi opened this issue Jul 2, 2022 · 5 comments

Comments

@sheosi
Copy link

sheosi commented Jul 2, 2022

Concretely I'm on version 1.61and while trying to compile a project with tflite in there this is what I get:

Checking tflite v0.9.6 (https://github.com/boncheolgu/tflite-rs#50ed6075)
error[E0740]: unions cannot contain fields that may need dropping
   --> /home/sergio/Documentos/Voice_Assistants/precise-rs/target/debug/build/tflite-f45dcb97c94f6ca3/out/tflite_types.rs:411:13
    |
411 |             pub _M_val: _Tp,
    |             ^^^^^^^^^^^^^^^
    |
    = note: a type is guaranteed not to need dropping when it implements `Copy`, or when it is the special `ManuallyDrop<_>` type
help: when the type does not implement `Copy`, wrap it inside a `ManuallyDrop<_>` and ensure it is manually dropped
    |
411 |             pub _M_val: std::mem::ManuallyDrop<_Tp>,
    |                         +++++++++++++++++++++++   +

For more information about this error, try `rustc --explain E0740`.
error: could not compile `tflite` due to previous error

Note that I compiled the project with older versions and this seems a problem of modern Rust with this lib.

@otaviojr
Copy link

+1

@Marekkon5
Copy link

I've made temporary hack which works with latest Rust: https://github.com/Marekkon5/tflite-rs (master branch)

@rkoopmans
Copy link

+1

@shtrophic
Copy link

I've made temporary hack which works with latest Rust: https://github.com/Marekkon5/tflite-rs (master branch)

How dirty do you consider this hack to be?

@Marekkon5
Copy link

@Sir-Photch it literally does a string replace on code on generated variable... The variable name can change at any time (with bindgen/tflite updates), and generally doing string replacements on code is NOT a good idea.

very very dirty.

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

5 participants