Bug 1771993 - Fix warnings about whitelist/blocklist functions being deprecated in bindgen 0.59. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D147695
This commit is contained in:
Mike Hommey 2022-05-31 21:40:29 +00:00
parent a7692218eb
commit 2b227894ee
3 changed files with 12 additions and 12 deletions

View File

@ -164,7 +164,7 @@ rusty-enums = [
"mozilla::StyleMaskComposite",
"mozilla::StyleWritingModeProperty",
]
whitelist-vars = [
allowlist-vars = [
"NS_ATTRVALUE_.*",
"NODE_.*",
"ELEMENT_.*",
@ -188,7 +188,7 @@ whitelist-vars = [
]
# TODO(emilio): A bunch of types here can go away once we generate bindings and
# structs together.
whitelist-types = [
allowlist-types = [
"RawGecko.*",
"RawServo.*",
"ServoCssRules",
@ -614,4 +614,4 @@ mapped-generic-types = [
{ generic = false, gecko = "nsString", servo = "nsstring::nsString" },
]
whitelist-functions = ["Servo_.*", "Gecko_.*"]
allowlist-functions = ["Servo_.*", "Gecko_.*"]

View File

@ -258,7 +258,7 @@ impl<'a> BuilderWithConfig<'a> {
fn handle_common(self, fixups: &mut Vec<Fixup>) -> BuilderWithConfig<'a> {
self.handle_str_items("headers", |b, item| b.header(add_include(item)))
.handle_str_items("raw-lines", |b, item| b.raw_line(item))
.handle_str_items("hide-types", |b, item| b.blacklist_type(item))
.handle_str_items("hide-types", |b, item| b.blocklist_type(item))
.handle_table_items("fixups", |builder, item| {
fixups.push(Fixup {
pat: item["pat"].as_str().unwrap().into(),
@ -285,16 +285,16 @@ fn generate_structs() {
let mut fixups = vec![];
let builder = BuilderWithConfig::new(builder, CONFIG["structs"].as_table().unwrap())
.handle_common(&mut fixups)
.handle_str_items("whitelist-functions", |b, item| b.whitelist_function(item))
.handle_str_items("allowlist-functions", |b, item| b.allowlist_function(item))
.handle_str_items("bitfield-enums", |b, item| b.bitfield_enum(item))
.handle_str_items("rusty-enums", |b, item| b.rustified_enum(item))
.handle_str_items("whitelist-vars", |b, item| b.whitelist_var(item))
.handle_str_items("whitelist-types", |b, item| b.whitelist_type(item))
.handle_str_items("allowlist-vars", |b, item| b.allowlist_var(item))
.handle_str_items("allowlist-types", |b, item| b.allowlist_type(item))
.handle_str_items("opaque-types", |b, item| b.opaque_type(item))
.handle_table_items("cbindgen-types", |b, item| {
let gecko = item["gecko"].as_str().unwrap();
let servo = item["servo"].as_str().unwrap();
b.blacklist_type(format!("mozilla::{}", gecko))
b.blocklist_type(format!("mozilla::{}", gecko))
.module_raw_line("root::mozilla", format!("pub use {} as {};", servo, gecko))
})
.handle_table_items("mapped-generic-types", |builder, item| {
@ -312,7 +312,7 @@ fn generate_structs() {
pat: format!("\\broot\\s*::\\s*{}\\b", gecko),
rep: format!("crate::gecko_bindings::structs::{}", gecko_name),
});
builder.blacklist_type(gecko).raw_line(format!(
builder.blocklist_type(gecko).raw_line(format!(
"pub type {0}{2} = {1}{2};",
gecko_name,
servo,

View File

@ -79,9 +79,9 @@ fn generate_bindings() {
let bindings = builder
.header(add_include("GeckoProfiler.h"))
.header(add_include("ProfilerBindings.h"))
.whitelist_function("gecko_profiler_.*")
.whitelist_var("mozilla::profiler::detail::RacyFeatures::sActiveAndFeatures")
.whitelist_type("mozilla::profiler::detail::RacyFeatures")
.allowlist_function("gecko_profiler_.*")
.allowlist_var("mozilla::profiler::detail::RacyFeatures::sActiveAndFeatures")
.allowlist_type("mozilla::profiler::detail::RacyFeatures")
.rustified_enum("mozilla::StackCaptureOptions")
.rustified_enum("mozilla::MarkerSchema_Location")
.rustified_enum("mozilla::MarkerSchema_Format")