diff --git a/build.rs b/build.rs index d6a59d41..558c1daf 100644 --- a/build.rs +++ b/build.rs @@ -239,7 +239,8 @@ fn import_tflite_types() { // Write the bindings to the $OUT_DIR/tflite_types.rs file. let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("tflite_types.rs"); - bindings.write_to_file(out_path).expect("Couldn't write bindings!"); + let bindings = bindings.to_string().replace("pub _M_val: _Tp", "pub _M_val: std::mem::ManuallyDrop<_Tp>"); + std::fs::write(out_path, bindings).expect("Couldn't write bindings!"); } fn build_inline_cpp() {