Bug 1868578 - Update CargoCallbacks usage in the profiler rust API r=aabh,profiler-reviewers

Previously CargoCallbacks was a unit-like struct. But with bindgen version
0.69.0, it's changed to a proper struct. To eliminate the breaking nature of
this change, they introduced another CargoCallbacks constant, but that's marked
as deprecated and we are currently using this instead of the new one. This
patch removes the usage of this deprecated constant and switches to the new
struct.

See the bindgen changelog here:
86f3dbe846/CHANGELOG.md (changed-1)

Differential Revision: https://phabricator.services.mozilla.com/D195649
This commit is contained in:
Nazım Can Altınova 2023-12-21 13:39:23 +00:00
Родитель db18d6caaf
Коммит 423c0ace70
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -10,7 +10,7 @@
#[macro_use]
extern crate lazy_static;
use bindgen::{Builder, CargoCallbacks, CodegenConfig};
use bindgen::{Builder, CodegenConfig};
use std::env;
use std::fs;
use std::path::PathBuf;
@ -97,7 +97,7 @@ fn generate_bindings() {
.raw_line("pub use self::root::*;")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(CargoCallbacks))
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
// Finish the builder and generate the bindings.
.generate()
// Unwrap the Result and panic on failure.