summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hlopko <hlopko@google.com>2021-02-11 08:58:46 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2021-02-18 17:25:13 +0100
commit0e25962c4e69aef647e7275fa7bc7545dbb8cd0b (patch)
treef51e49624d79a707069bbfdeb0f15b78219cec94
parente59aa9218b0e862cbaed319582bf0b692dfacde2 (diff)
Rename whitelist -> allowlist and blacklist -> blocklist
For the commandline arguments I added undocumented aliases to old flags, to stay backwards compatible.
-rw-r--r--CHANGELOG.md36
-rw-r--r--bindgen-integration/build.rs2
-rw-r--r--book/src/SUMMARY.md4
-rw-r--r--book/src/allowlisting.md31
-rw-r--r--book/src/blocklisting.md (renamed from book/src/blacklisting.md)13
-rw-r--r--book/src/cpp.md4
-rw-r--r--book/src/faq.md6
-rw-r--r--book/src/objc.md4
-rw-r--r--book/src/replacing-types.md2
-rw-r--r--book/src/whitelisting.md31
-rw-r--r--src/codegen/impl_debug.rs4
-rw-r--r--src/codegen/mod.rs10
-rw-r--r--src/ir/analysis/derive.rs10
-rw-r--r--src/ir/analysis/has_destructor.rs2
-rw-r--r--src/ir/analysis/has_float.rs2
-rw-r--r--src/ir/analysis/has_type_param_in_array.rs2
-rw-r--r--src/ir/analysis/has_vtable.rs2
-rw-r--r--src/ir/analysis/mod.rs4
-rw-r--r--src/ir/analysis/sizedness.rs2
-rw-r--r--src/ir/analysis/template_params.rs60
-rw-r--r--src/ir/context.rs136
-rw-r--r--src/ir/dot.rs6
-rw-r--r--src/ir/enum_ty.rs2
-rw-r--r--src/ir/item.rs44
-rw-r--r--src/ir/template.rs4
-rw-r--r--src/ir/traversal.rs4
-rw-r--r--src/lib.rs213
-rw-r--r--src/options.rs83
-rw-r--r--tests/expectations/tests/allowlist-namespaces-basic.rs (renamed from tests/expectations/tests/whitelist-namespaces-basic.rs)0
-rw-r--r--tests/expectations/tests/allowlist-namespaces.rs (renamed from tests/expectations/tests/whitelist-namespaces.rs)0
-rw-r--r--tests/expectations/tests/allowlist_basic.rs (renamed from tests/expectations/tests/whitelist_basic.rs)10
-rw-r--r--tests/expectations/tests/allowlist_fix.rs (renamed from tests/expectations/tests/whitelist_fix.rs)0
-rw-r--r--tests/expectations/tests/allowlist_vars.rs (renamed from tests/expectations/tests/whitelist_vars.rs)0
-rw-r--r--tests/expectations/tests/allowlisted-item-references-no-hash.rs (renamed from tests/expectations/tests/whitelisted-item-references-no-hash.rs)16
-rw-r--r--tests/expectations/tests/allowlisted-item-references-no-partialeq.rs (renamed from tests/expectations/tests/whitelisted-item-references-no-partialeq.rs)16
-rw-r--r--tests/expectations/tests/allowlisted_item_references_no_copy.rs (renamed from tests/expectations/tests/whitelisted_item_references_no_copy.rs)16
-rw-r--r--tests/expectations/tests/anon_enum_allowlist.rs (renamed from tests/expectations/tests/anon_enum_whitelist.rs)0
-rw-r--r--tests/expectations/tests/blocklist-and-impl-debug.rs (renamed from tests/expectations/tests/blacklist-and-impl-debug.rs)6
-rw-r--r--tests/expectations/tests/blocklist-function.rs (renamed from tests/expectations/tests/blacklist-function.rs)0
-rw-r--r--tests/expectations/tests/blocklist-item.rs (renamed from tests/expectations/tests/blacklist-item.rs)0
-rw-r--r--tests/expectations/tests/derive-default-and-blocklist.rs (renamed from tests/expectations/tests/derive-default-and-blacklist.rs)6
-rw-r--r--tests/expectations/tests/derive-hash-and-blocklist.rs (renamed from tests/expectations/tests/derive-hash-and-blacklist.rs)6
-rw-r--r--tests/expectations/tests/derive-hash-blocklisting.rs (renamed from tests/expectations/tests/derive-hash-blacklisting.rs)46
-rw-r--r--tests/expectations/tests/derive-partialeq-and-blocklist.rs (renamed from tests/expectations/tests/derive-partialeq-and-blacklist.rs)6
-rw-r--r--tests/expectations/tests/dynamic_loading_with_allowlist.rs (renamed from tests/expectations/tests/dynamic_loading_with_whitelist.rs)0
-rw-r--r--tests/expectations/tests/dynamic_loading_with_blocklist.rs (renamed from tests/expectations/tests/dynamic_loading_with_blacklist.rs)0
-rw-r--r--tests/expectations/tests/inline_namespace_allowlist.rs (renamed from tests/expectations/tests/inline_namespace_whitelist.rs)0
-rw-r--r--tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs16
-rw-r--r--tests/expectations/tests/issue-944-derive-copy-and-blocklisting.rs (renamed from tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs)6
-rw-r--r--tests/expectations/tests/module-allowlisted.rs (renamed from tests/expectations/tests/module-whitelisted.rs)0
-rw-r--r--tests/expectations/tests/no-derive-debug.rs2
-rw-r--r--tests/expectations/tests/no-derive-default.rs2
-rw-r--r--tests/expectations/tests/no-hash-allowlisted.rs (renamed from tests/expectations/tests/no-hash-whitelisted.rs)0
-rw-r--r--tests/expectations/tests/no-partialeq-allowlisted.rs (renamed from tests/expectations/tests/no-partialeq-whitelisted.rs)0
-rw-r--r--tests/expectations/tests/no-recursive-allowlisting.rs (renamed from tests/expectations/tests/no-recursive-whitelisting.rs)0
-rw-r--r--tests/expectations/tests/no_copy_allowlisted.rs (renamed from tests/expectations/tests/no_copy_whitelisted.rs)0
-rw-r--r--tests/expectations/tests/no_debug_allowlisted.rs (renamed from tests/expectations/tests/no_debug_whitelisted.rs)0
-rw-r--r--tests/expectations/tests/no_default_allowlisted.rs (renamed from tests/expectations/tests/no_default_whitelisted.rs)0
-rw-r--r--tests/expectations/tests/objc_allowlist.rs (renamed from tests/expectations/tests/objc_whitelist.rs)4
-rw-r--r--tests/expectations/tests/type-referenced-by-allowlisted-function.rs (renamed from tests/expectations/tests/type-referenced-by-whitelisted-function.rs)0
-rw-r--r--tests/headers/allowlist-namespaces-basic.hpp (renamed from tests/headers/whitelist-namespaces-basic.hpp)2
-rw-r--r--tests/headers/allowlist-namespaces.hpp (renamed from tests/headers/whitelist-namespaces.hpp)2
-rw-r--r--tests/headers/allowlist_basic.hpp (renamed from tests/headers/whitelist_basic.hpp)6
-rw-r--r--tests/headers/allowlist_fix.hpp (renamed from tests/headers/whitelist_fix.hpp)2
-rw-r--r--tests/headers/allowlist_vars.h (renamed from tests/headers/whitelist_vars.h)0
-rw-r--r--tests/headers/allowlisted-item-references-no-hash.hpp7
-rw-r--r--tests/headers/allowlisted-item-references-no-partialeq.hpp7
-rw-r--r--tests/headers/allowlisted_item_references_no_copy.hpp7
-rw-r--r--tests/headers/anon_enum_allowlist.h6
-rw-r--r--tests/headers/anon_enum_whitelist.h6
-rw-r--r--tests/headers/blacklist-and-impl-debug.hpp10
-rw-r--r--tests/headers/blocklist-and-impl-debug.hpp10
-rw-r--r--tests/headers/blocklist-function.hpp (renamed from tests/headers/blacklist-function.hpp)2
-rw-r--r--tests/headers/blocklist-item.hpp (renamed from tests/headers/blacklist-item.hpp)2
-rw-r--r--tests/headers/derive-default-and-blocklist.hpp (renamed from tests/headers/derive-default-and-blacklist.hpp)8
-rw-r--r--tests/headers/derive-hash-and-blacklist.hpp10
-rw-r--r--tests/headers/derive-hash-and-blocklist.hpp10
-rw-r--r--tests/headers/derive-hash-blacklisting.hpp17
-rw-r--r--tests/headers/derive-hash-blocklisting.hpp17
-rw-r--r--tests/headers/derive-partialeq-and-blacklist.hpp11
-rw-r--r--tests/headers/derive-partialeq-and-blocklist.hpp11
-rw-r--r--tests/headers/dynamic_loading_with_allowlist.hpp (renamed from tests/headers/dynamic_loading_with_whitelist.hpp)2
-rw-r--r--tests/headers/dynamic_loading_with_blocklist.hpp (renamed from tests/headers/dynamic_loading_with_blacklist.hpp)2
-rw-r--r--tests/headers/inline_namespace_allowlist.hpp (renamed from tests/headers/inline_namespace_whitelist.hpp)2
-rw-r--r--tests/headers/issue-1285.h2
-rw-r--r--tests/headers/issue-410.hpp2
-rw-r--r--tests/headers/issue-447.hpp2
-rw-r--r--tests/headers/issue-584-stylo-template-analysis-panic.hpp2
-rw-r--r--tests/headers/issue-645-cannot-find-type-T-in-this-scope.hpp2
-rw-r--r--tests/headers/issue-662-part-2.hpp4
-rw-r--r--tests/headers/issue-674-1.hpp2
-rw-r--r--tests/headers/issue-674-2.hpp2
-rw-r--r--tests/headers/issue-674-3.hpp2
-rw-r--r--tests/headers/issue-769-bad-instantiation-test.hpp2
-rw-r--r--tests/headers/issue-801-opaque-sloppiness.hpp2
-rw-r--r--tests/headers/issue-807-opaque-types-methods-being-generated.hpp8
-rw-r--r--tests/headers/issue-833-1.hpp2
-rw-r--r--tests/headers/issue-833.hpp2
-rw-r--r--tests/headers/issue-834.hpp2
-rw-r--r--tests/headers/issue-944-derive-copy-and-blacklisting.hpp10
-rw-r--r--tests/headers/issue-944-derive-copy-and-blocklisting.hpp10
-rw-r--r--tests/headers/maddness-is-avoidable.hpp2
-rw-r--r--tests/headers/module-allowlisted.hpp (renamed from tests/headers/module-whitelisted.hpp)0
-rw-r--r--tests/headers/no-derive-debug.h4
-rw-r--r--tests/headers/no-derive-default.h4
-rw-r--r--tests/headers/no-hash-allowlisted.hpp5
-rw-r--r--tests/headers/no-hash-whitelisted.hpp5
-rw-r--r--tests/headers/no-partialeq-allowlisted.hpp (renamed from tests/headers/no-partialeq-whitelisted.hpp)2
-rw-r--r--tests/headers/no-recursive-allowlisting.h (renamed from tests/headers/no-recursive-whitelisting.h)2
-rw-r--r--tests/headers/no_copy_allowlisted.hpp5
-rw-r--r--tests/headers/no_copy_whitelisted.hpp5
-rw-r--r--tests/headers/no_debug_allowlisted.hpp5
-rw-r--r--tests/headers/no_debug_whitelisted.hpp5
-rw-r--r--tests/headers/no_default_allowlisted.hpp5
-rw-r--r--tests/headers/no_default_whitelisted.hpp5
-rw-r--r--tests/headers/objc_allowlist.h24
-rw-r--r--tests/headers/objc_whitelist.h24
-rw-r--r--tests/headers/opaque-tracing.hpp4
-rw-r--r--tests/headers/replaces_double.hpp2
-rw-r--r--tests/headers/type-referenced-by-allowlisted-function.h (renamed from tests/headers/type-referenced-by-whitelisted-function.h)2
-rw-r--r--tests/headers/type_alias_empty.hpp4
-rw-r--r--tests/headers/type_alias_template_specialized.hpp2
-rw-r--r--tests/headers/var-tracing.hpp2
-rw-r--r--tests/headers/whitelisted-item-references-no-hash.hpp7
-rw-r--r--tests/headers/whitelisted-item-references-no-partialeq.hpp7
-rw-r--r--tests/headers/whitelisted_item_references_no_copy.hpp7
-rw-r--r--tests/stylo.hpp2
-rwxr-xr-xtests/stylo_sanity.rs406
128 files changed, 867 insertions, 778 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3792ad80..46607f51 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -127,6 +127,42 @@
## Deprecated
+* `bindgen::Builder::whitelist_type` is deprecated in favor of
+ `bindgen::Builder::allowlist_type`. [#1812][]
+
+* `bindgen::Builder::whitelist_function` is deprecated in favor of
+ `bindgen::Builder::allowlist_function`. [#1812][]
+
+* `bindgen::Builder::whitelist_var` is deprecated in favor of
+ `bindgen::Builder::allowlist_var`. [#1812][]
+
+* `--whitelist-type` is deprecated in favor of
+ `--allowlist-type`. [#1812][]
+
+* `--whitelist-function` is deprecated in favor of
+ `--allowlist-function`. [#1812][]
+
+* `--whitelist-var` is deprecated in favor of
+ `--allowlist-var`. [#1812][]
+
+* `bindgen::Builder::blacklist_type` is deprecated in favor of
+ `bindgen::Builder::blocklist_type`. [#1812][]
+
+* `bindgen::Builder::blacklist_function` is deprecated in favor of
+ `bindgen::Builder::blocklist_function`. [#1812][]
+
+* `bindgen::Builder::blacklist_item` is deprecated in favor of
+ `bindgen::Builder::blocklist_item`. [#1812][]
+
+* `--blacklist-type` is deprecated in favor of
+ `--blocklist-type`. [#1812][]
+
+* `--blacklist-function` is deprecated in favor of
+ `--blocklist-function`. [#1812][]
+
+* `--blacklist-item` is deprecated in favor of
+ `--blocklist-item`. [#1812][]
+
## Removed
## Fixed
diff --git a/bindgen-integration/build.rs b/bindgen-integration/build.rs
index 1b9a7915..f055f31f 100644
--- a/bindgen-integration/build.rs
+++ b/bindgen-integration/build.rs
@@ -160,7 +160,7 @@ fn main() {
seen_hellos: Mutex::new(0),
seen_funcs: Mutex::new(0),
}))
- .blacklist_function("my_prefixed_function_to_remove")
+ .blocklist_function("my_prefixed_function_to_remove")
.constified_enum("my_prefixed_enum_to_be_constified")
.opaque_type("my_prefixed_templated_foo<my_prefixed_baz>")
.generate()
diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md
index 16291c36..65ed0870 100644
--- a/book/src/SUMMARY.md
+++ b/book/src/SUMMARY.md
@@ -12,8 +12,8 @@
- [Publish Your Crate!](./tutorial-6.md)
- [Command Line Usage](./command-line-usage.md)
- [Customizing the Generated Bindings](./customizing-generated-bindings.md)
- - [Whitelisting](./whitelisting.md)
- - [Blacklisting](./blacklisting.md)
+ - [Allowlisting](./allowlisting.md)
+ - [Blocklisting](./blocklisting.md)
- [Treating a Type as an Opaque Blob of Bytes](./opaque.md)
- [Replacing One Type with Another](./replacing-types.md)
- [Preventing the Derivation of `Copy` and `Clone`](./nocopy.md)
diff --git a/book/src/allowlisting.md b/book/src/allowlisting.md
new file mode 100644
index 00000000..8c57eaf3
--- /dev/null
+++ b/book/src/allowlisting.md
@@ -0,0 +1,31 @@
+# Allowlisting
+
+Allowlisting allows us to be precise about which type, function, and global
+variable definitions `bindgen` generates bindings for. By default, if we don't
+specify any allowlisting rules, everything is considered allowlisted. This may
+not be desirable because of either
+
+* the generated bindings contain a lot of extra definitions we don't plan on using, or
+* the header file contains C++ features for which Rust does not have a
+ corresponding form (such as partial template specialization), and we would
+ like to avoid these definitions
+
+If we specify allowlisting rules, then `bindgen` will only generate bindings to
+types, functions, and global variables that match the allowlisting rules, or are
+transitively used by a definition that matches them.
+
+### Library
+
+* [`bindgen::Builder::allowlist_type`](https://docs.rs/bindgen/0.23.1/bindgen/struct.Builder.html#method.allowlist_type)
+* [`bindgen::Builder::allowlist_function`](https://docs.rs/bindgen/0.23.1/bindgen/struct.Builder.html#method.allowlist_function)
+* [`bindgen::Builder::allowlist_var`](https://docs.rs/bindgen/0.23.1/bindgen/struct.Builder.html#method.allowlist_var)
+
+### Command Line
+
+* `--allowlist-type <type>`
+* `--allowlist-function <function>`
+* `--allowlist-var <var>`
+
+### Annotations
+
+None.
diff --git a/book/src/blacklisting.md b/book/src/blocklisting.md
index b56aacd9..1d608616 100644
--- a/book/src/blacklisting.md
+++ b/book/src/blocklisting.md
@@ -1,24 +1,25 @@
-# Blacklisting
+# Blocklisting
If you need to provide your own custom translation of some type (for example,
because you need to wrap one of its fields in an `UnsafeCell`), you can
-explicitly blacklist generation of its definition. Uses of the blacklisted type
+explicitly blocklist
+ generation of its definition. Uses of the blocklisted type
will still appear in other types' definitions. (If you don't want the type to
appear in the bindings at
all, [make it opaque](./opaque.md) instead of
-blacklisting it.)
+blocklisting it.)
-Blacklisted types are pessimistically assumed not to be able to `derive` any
+Blocklisted types are pessimistically assumed not to be able to `derive` any
traits, which can transitively affect other types' ability to `derive` traits or
not.
### Library
-* [`bindgen::Builder::blacklist_type`](https://docs.rs/bindgen/0.31.3/bindgen/struct.Builder.html#method.blacklist_type)
+* [`bindgen::Builder::blocklist_type`](https://docs.rs/bindgen/0.31.3/bindgen/struct.Builder.html#method.blocklist_type)
### Command Line
-* `--blacklist-type <type>`
+* `--blocklist-type <type>`
### Annotations
diff --git a/book/src/cpp.md b/book/src/cpp.md
index 6fef6391..1be7a8a7 100644
--- a/book/src/cpp.md
+++ b/book/src/cpp.md
@@ -11,11 +11,11 @@ it ends in `.hpp`. If it doesn't, adding `-x c++` clang args can be used to
force C++ mode. You probably also want to use `-std=c++14` or similar clang args
as well.
-You pretty much **must** use [whitelisting](./whitelisting.md) when working
+You pretty much **must** use [allowlisting](./allowlisting.md) when working
with C++ to avoid pulling in all of the `std::.*` types, many of which `bindgen`
cannot handle. Additionally, you may want to mark other types as
[opaque](./opaque.md) that `bindgen` stumbles on. It is recommended to mark
-all of `std::.*` opaque, and to whitelist only precisely the functions and types
+all of `std::.*` opaque, and to allowlist only precisely the functions and types
you intend to use.
You should read up on the [FAQs](./faq.md) as well.
diff --git a/book/src/faq.md b/book/src/faq.md
index 50ca0756..61e40e35 100644
--- a/book/src/faq.md
+++ b/book/src/faq.md
@@ -4,13 +4,13 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
-- [Why isn't `bindgen` generating methods for this whitelisted class?](#why-isnt-bindgen-generating-methods-for-this-whitelisted-class)
+- [Why isn't `bindgen` generating methods for this allowlisted class?](#why-isnt-bindgen-generating-methods-for-this-allowlisted-class)
- [Why isn't `bindgen` generating bindings to inline functions?](#why-isnt-bindgen-generating-bindings-to-inline-functions)
- [Does `bindgen` support the C++ Standard Template Library (STL)?](#does-bindgen-support-the-c-standard-template-library-stl)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
-### Why isn't `bindgen` generating methods for this whitelisted class?
+### Why isn't `bindgen` generating methods for this allowlisted class?
Are the methods `inline` methods, or defined inline in the class? For example:
@@ -62,7 +62,7 @@ STL. That ties our hands when it comes to linking: ["Why isn't `bindgen` generat
As far as generating opaque blobs of bytes with the correct size and alignment,
`bindgen` can do pretty well. This is typically enough to let you use types that
transitively contain STL things. We generally recommend marking `std::.*` as
-opaque, and then whitelisting only the specific things you need from the library
+opaque, and then allowlisting only the specific things you need from the library
you're binding to that is pulling in STL headers.
### How to deal with bindgen generated padding fields?
diff --git a/book/src/objc.md b/book/src/objc.md
index aad7ee60..55ec5e0b 100644
--- a/book/src/objc.md
+++ b/book/src/objc.md
@@ -1,7 +1,7 @@
# Generating Bindings to Objective-C
`bindgen` does not (yet) have full objective-c support but it can generate bindings
-for a lot of the apple frameworks without too much blacklisting.
+for a lot of the apple frameworks without too much blocklisting.
In order to generate bindings, you will need `-x objective-c` as the clang
args. If you'd like to use [block](https://crates.io/crates/block) you will need
@@ -49,7 +49,7 @@ name and `id` is a pointer to the objective-c Object.
`--target=arm64-apple-ios` as mentioned
[here](https://github.com/rust-lang/rust-bindgen/issues/1211#issuecomment-569804287).
* The generated bindings will almost certainly have some conflicts so you will
-have to blacklist a few things. There are a few cases of the parameters being
+have to blocklist a few things. There are a few cases of the parameters being
poorly named in the objective-c headers. But if you're using anything with
Core Foundation, you'll find that `time.h` as has a variable called timezone that
conflicts with some of the things in `NSCalendar.h`.
diff --git a/book/src/replacing-types.md b/book/src/replacing-types.md
index cf3dd17a..f47d945d 100644
--- a/book/src/replacing-types.md
+++ b/book/src/replacing-types.md
@@ -24,4 +24,4 @@ That way, after code generation, the bindings for the `nsTArray` type are
the ones that would be generated for `nsTArray_Simple`.
Replacing is only available as an annotation. To replace a C or C++ definition
-with a Rust definition, use [blacklisting](./blacklisting.md).
+with a Rust definition, use [blocklisting](./blocklisting.md).
diff --git a/book/src/whitelisting.md b/book/src/whitelisting.md
deleted file mode 100644
index 749b56b0..00000000
--- a/book/src/whitelisting.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Whitelisting
-
-Whitelisting allows us to be precise about which type, function, and global
-variable definitions `bindgen` generates bindings for. By default, if we don't
-specify any whitelisting rules, everything is considered whitelisted. This may
-not be desirable because of either
-
-* the generated bindings contain a lot of extra definitions we don't plan on using, or
-* the header file contains C++ features for which Rust does not have a
- corresponding form (such as partial template specialization), and we would
- like to avoid these definitions
-
-If we specify whitelisting rules, then `bindgen` will only generate bindings to
-types, functions, and global variables that match the whitelisting rules, or are
-transitively used by a definition that matches them.
-
-### Library
-
-* [`bindgen::Builder::whitelist_type`](https://docs.rs/bindgen/0.23.1/bindgen/struct.Builder.html#method.whitelist_type)
-* [`bindgen::Builder::whitelist_function`](https://docs.rs/bindgen/0.23.1/bindgen/struct.Builder.html#method.whitelist_function)
-* [`bindgen::Builder::whitelist_var`](https://docs.rs/bindgen/0.23.1/bindgen/struct.Builder.html#method.whitelist_var)
-
-### Command Line
-
-* `--whitelist-type <type>`
-* `--whitelist-function <function>`
-* `--whitelist-var <var>`
-
-### Annotations
-
-None.
diff --git a/src/codegen/impl_debug.rs b/src/codegen/impl_debug.rs
index ed1a5e25..b8fdd0d4 100644
--- a/src/codegen/impl_debug.rs
+++ b/src/codegen/impl_debug.rs
@@ -120,9 +120,9 @@ impl<'a> ImplDebug<'a> for Item {
) -> Option<(String, Vec<proc_macro2::TokenStream>)> {
let name_ident = ctx.rust_ident(name);
- // We don't know if blacklisted items `impl Debug` or not, so we can't
+ // We don't know if blocklisted items `impl Debug` or not, so we can't
// add them to the format string we're building up.
- if !ctx.whitelisted_items().contains(&self.id()) {
+ if !ctx.allowlisted_items().contains(&self.id()) {
return None;
}
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 6a7660f6..62271acf 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -443,7 +443,7 @@ impl CodeGenerator for Item {
return;
}
- if self.is_blacklisted(ctx) || result.seen(self.id()) {
+ if self.is_blocklisted(ctx) || result.seen(self.id()) {
debug!(
"<Item as CodeGenerator>::codegen: Ignoring hidden or seen: \
self = {:?}",
@@ -457,7 +457,7 @@ impl CodeGenerator for Item {
// TODO(emilio, #453): Figure out what to do when this happens
// legitimately, we could track the opaque stuff and disable the
// assertion there I guess.
- warn!("Found non-whitelisted item in code generation: {:?}", self);
+ warn!("Found non-allowlisted item in code generation: {:?}", self);
}
result.set_seen(self.id());
@@ -725,7 +725,7 @@ impl CodeGenerator for Type {
// These items don't need code generation, they only need to be
// converted to rust types in fields, arguments, and such.
// NOTE(emilio): If you add to this list, make sure to also add
- // it to BindgenContext::compute_whitelisted_and_codegen_items.
+ // it to BindgenContext::compute_allowlisted_and_codegen_items.
return;
}
TypeKind::TemplateInstantiation(ref inst) => {
@@ -2261,8 +2261,8 @@ impl MethodCodegen for Method {
// First of all, output the actual function.
let function_item = ctx.resolve_item(self.signature());
- if function_item.is_blacklisted(ctx) {
- // We shouldn't emit a method declaration if the function is blacklisted
+ if function_item.is_blocklisted(ctx) {
+ // We shouldn't emit a method declaration if the function is blocklisted
return;
}
function_item.codegen(ctx, result, &());
diff --git a/src/ir/analysis/derive.rs b/src/ir/analysis/derive.rs
index 6c50fa6c..fa4ce795 100644
--- a/src/ir/analysis/derive.rs
+++ b/src/ir/analysis/derive.rs
@@ -138,9 +138,9 @@ impl<'ctx> CannotDerive<'ctx> {
}
fn constrain_type(&mut self, item: &Item, ty: &Type) -> CanDerive {
- if !self.ctx.whitelisted_items().contains(&item.id()) {
+ if !self.ctx.allowlisted_items().contains(&item.id()) {
trace!(
- " cannot derive {} for blacklisted type",
+ " cannot derive {} for blocklisted type",
self.derive_trait
);
return CanDerive::No;
@@ -640,10 +640,10 @@ impl<'ctx> MonotoneFramework for CannotDerive<'ctx> {
}
fn initial_worklist(&self) -> Vec<ItemId> {
- // The transitive closure of all whitelisted items, including explicitly
- // blacklisted items.
+ // The transitive closure of all allowlisted items, including explicitly
+ // blocklisted items.
self.ctx
- .whitelisted_items()
+ .allowlisted_items()
.iter()
.cloned()
.flat_map(|i| {
diff --git a/src/ir/analysis/has_destructor.rs b/src/ir/analysis/has_destructor.rs
index ca4f2532..5fa22e3f 100644
--- a/src/ir/analysis/has_destructor.rs
+++ b/src/ir/analysis/has_destructor.rs
@@ -83,7 +83,7 @@ impl<'ctx> MonotoneFramework for HasDestructorAnalysis<'ctx> {
}
fn initial_worklist(&self) -> Vec<ItemId> {
- self.ctx.whitelisted_items().iter().cloned().collect()
+ self.ctx.allowlisted_items().iter().cloned().collect()
}
fn constrain(&mut self, id: ItemId) -> ConstrainResult {
diff --git a/src/ir/analysis/has_float.rs b/src/ir/analysis/has_float.rs
index d21e651d..bbf2126f 100644
--- a/src/ir/analysis/has_float.rs
+++ b/src/ir/analysis/has_float.rs
@@ -94,7 +94,7 @@ impl<'ctx> MonotoneFramework for HasFloat<'ctx> {
}
fn initial_worklist(&self) -> Vec<ItemId> {
- self.ctx.whitelisted_items().iter().cloned().collect()
+ self.ctx.allowlisted_items().iter().cloned().collect()
}
fn constrain(&mut self, id: ItemId) -> ConstrainResult {
diff --git a/src/ir/analysis/has_type_param_in_array.rs b/src/ir/analysis/has_type_param_in_array.rs
index ebdb7e34..aa523047 100644
--- a/src/ir/analysis/has_type_param_in_array.rs
+++ b/src/ir/analysis/has_type_param_in_array.rs
@@ -100,7 +100,7 @@ impl<'ctx> MonotoneFramework for HasTypeParameterInArray<'ctx> {
}
fn initial_worklist(&self) -> Vec<ItemId> {
- self.ctx.whitelisted_items().iter().cloned().collect()
+ self.ctx.allowlisted_items().iter().cloned().collect()
}
fn constrain(&mut self, id: ItemId) -> ConstrainResult {
diff --git a/src/ir/analysis/has_vtable.rs b/src/ir/analysis/has_vtable.rs
index d2a57d5a..7f5f9117 100644
--- a/src/ir/analysis/has_vtable.rs
+++ b/src/ir/analysis/has_vtable.rs
@@ -147,7 +147,7 @@ impl<'ctx> MonotoneFramework for HasVtableAnalysis<'ctx> {
}
fn initial_worklist(&self) -> Vec<ItemId> {
- self.ctx.whitelisted_items().iter().cloned().collect()
+ self.ctx.allowlisted_items().iter().cloned().collect()
}
fn constrain(&mut self, id: ItemId) -> ConstrainResult {
diff --git a/src/ir/analysis/mod.rs b/src/ir/analysis/mod.rs
index 2cb021f0..ec4d20f9 100644
--- a/src/ir/analysis/mod.rs
+++ b/src/ir/analysis/mod.rs
@@ -183,7 +183,7 @@ where
{
let mut dependencies = HashMap::default();
- for &item in ctx.whitelisted_items() {
+ for &item in ctx.allowlisted_items() {
dependencies.entry(item).or_insert(vec![]);
{
@@ -192,7 +192,7 @@ where
item.trace(
ctx,
&mut |sub_item: ItemId, edge_kind| {
- if ctx.whitelisted_items().contains(&sub_item) &&
+ if ctx.allowlisted_items().contains(&sub_item) &&
consider_edge(edge_kind)
{
dependencies
diff --git a/src/ir/analysis/sizedness.rs b/src/ir/analysis/sizedness.rs
index d8bced72..a3ef7531 100644
--- a/src/ir/analysis/sizedness.rs
+++ b/src/ir/analysis/sizedness.rs
@@ -194,7 +194,7 @@ impl<'ctx> MonotoneFramework for SizednessAnalysis<'ctx> {
fn initial_worklist(&self) -> Vec<TypeId> {
self.ctx
- .whitelisted_items()
+ .allowlisted_items()
.iter()
.cloned()
.filter_map(|id| id.as_type_id(self.ctx))
diff --git a/src/ir/analysis/template_params.rs b/src/ir/analysis/template_params.rs
index f0d9b5e8..c2f18b1f 100644
--- a/src/ir/analysis/template_params.rs
+++ b/src/ir/analysis/template_params.rs
@@ -137,13 +137,13 @@ use crate::{HashMap, HashSet};
/// analysis. If we didn't, then we would mistakenly determine that ever
/// template parameter is always used.
///
-/// The final wrinkle is handling of blacklisted types. Normally, we say that
-/// the set of whitelisted items is the transitive closure of items explicitly
-/// called out for whitelisting, *without* any items explicitly called out as
-/// blacklisted. However, for the purposes of this analysis's correctness, we
+/// The final wrinkle is handling of blocklisted types. Normally, we say that
+/// the set of allowlisted items is the transitive closure of items explicitly
+/// called out for allowlisting, *without* any items explicitly called out as
+/// blocklisted. However, for the purposes of this analysis's correctness, we
/// simplify and consider run the analysis on the full transitive closure of
-/// whitelisted items. We do, however, treat instantiations of blacklisted items
-/// specially; see `constrain_instantiation_of_blacklisted_template` and its
+/// allowlisted items. We do, however, treat instantiations of blocklisted items
+/// specially; see `constrain_instantiation_of_blocklisted_template` and its
/// documentation for details.
#[derive(Debug, Clone)]
pub struct UsedTemplateParameters<'ctx> {
@@ -155,10 +155,10 @@ pub struct UsedTemplateParameters<'ctx> {
dependencies: HashMap<ItemId, Vec<ItemId>>,
- // The set of whitelisted items, without any blacklisted items reachable
- // from the whitelisted items which would otherwise be considered
- // whitelisted as well.
- whitelisted_items: HashSet<ItemId>,
+ // The set of allowlisted items, without any blocklisted items reachable
+ // from the allowlisted items which would otherwise be considered
+ // allowlisted as well.
+ allowlisted_items: HashSet<ItemId>,
}
impl<'ctx> UsedTemplateParameters<'ctx> {
@@ -221,19 +221,19 @@ impl<'ctx> UsedTemplateParameters<'ctx> {
)
}
- /// We say that blacklisted items use all of their template parameters. The
- /// blacklisted type is most likely implemented explicitly by the user,
+ /// We say that blocklisted items use all of their template parameters. The
+ /// blocklisted type is most likely implemented explicitly by the user,
/// since it won't be in the generated bindings, and we don't know exactly
/// what they'll to with template parameters, but we can push the issue down
/// the line to them.
- fn constrain_instantiation_of_blacklisted_template(
+ fn constrain_instantiation_of_blocklisted_template(
&self,
this_id: ItemId,
used_by_this_id: &mut ItemSet,
instantiation: &TemplateInstantiation,
) {
trace!(
- " instantiation of blacklisted template, uses all template \
+ " instantiation of blocklisted template, uses all template \
arguments"
);
@@ -379,10 +379,10 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
fn new(ctx: &'ctx BindgenContext) -> UsedTemplateParameters<'ctx> {
let mut used = HashMap::default();
let mut dependencies = HashMap::default();
- let whitelisted_items: HashSet<_> =
- ctx.whitelisted_items().iter().cloned().collect();
+ let allowlisted_items: HashSet<_> =
+ ctx.allowlisted_items().iter().cloned().collect();
- let whitelisted_and_blacklisted_items: ItemSet = whitelisted_items
+ let allowlisted_and_blocklisted_items: ItemSet = allowlisted_items
.iter()
.cloned()
.flat_map(|i| {
@@ -398,7 +398,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
})
.collect();
- for item in whitelisted_and_blacklisted_items {
+ for item in allowlisted_and_blocklisted_items {
dependencies.entry(item).or_insert(vec![]);
used.entry(item).or_insert(Some(ItemSet::new()));
@@ -457,17 +457,17 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
}
if cfg!(feature = "testing_only_extra_assertions") {
- // Invariant: The `used` map has an entry for every whitelisted
- // item, as well as all explicitly blacklisted items that are
- // reachable from whitelisted items.
+ // Invariant: The `used` map has an entry for every allowlisted
+ // item, as well as all explicitly blocklisted items that are
+ // reachable from allowlisted items.
//
// Invariant: the `dependencies` map has an entry for every
- // whitelisted item.
+ // allowlisted item.
//
// (This is so that every item we call `constrain` on is guaranteed
// to have a set of template parameters, and we can allow
- // blacklisted templates to use all of their parameters).
- for item in whitelisted_items.iter() {
+ // blocklisted templates to use all of their parameters).
+ for item in allowlisted_items.iter() {
extra_assert!(used.contains_key(item));
extra_assert!(dependencies.contains_key(item));
item.trace(
@@ -485,15 +485,15 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
ctx: ctx,
used: used,
dependencies: dependencies,
- whitelisted_items: whitelisted_items,
+ allowlisted_items: allowlisted_items,
}
}
fn initial_worklist(&self) -> Vec<ItemId> {
- // The transitive closure of all whitelisted items, including explicitly
- // blacklisted items.
+ // The transitive closure of all allowlisted items, including explicitly
+ // blocklisted items.
self.ctx
- .whitelisted_items()
+ .allowlisted_items()
.iter()
.cloned()
.flat_map(|i| {
@@ -538,7 +538,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
// template definition uses the corresponding template parameter.
Some(&TypeKind::TemplateInstantiation(ref inst)) => {
if self
- .whitelisted_items
+ .allowlisted_items
.contains(&inst.template_definition().into())
{
self.constrain_instantiation(
@@ -547,7 +547,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> {
inst,
);
} else {
- self.constrain_instantiation_of_blacklisted_template(
+ self.constrain_instantiation_of_blocklisted_template(
id,
&mut used_by_this_id,
inst,
diff --git a/src/ir/context.rs b/src/ir/context.rs
index 0207547a..6a0f07d9 100644
--- a/src/ir/context.rs
+++ b/src/ir/context.rs
@@ -376,14 +376,14 @@ pub struct BindgenContext {
/// Whether a bindgen complex was generated
generated_bindgen_complex: Cell<bool>,
- /// The set of `ItemId`s that are whitelisted. This the very first thing
+ /// The set of `ItemId`s that are allowlisted. This the very first thing
/// computed after parsing our IR, and before running any of our analyses.
- whitelisted: Option<ItemSet>,
+ allowlisted: Option<ItemSet>,
- /// The set of `ItemId`s that are whitelisted for code generation _and_ that
+ /// The set of `ItemId`s that are allowlisted for code generation _and_ that
/// we should generate accounting for the codegen options.
///
- /// It's computed right after computing the whitelisted items.
+ /// It's computed right after computing the allowlisted items.
codegen_items: Option<ItemSet>,
/// Map from an item's id to the set of template parameter items that it
@@ -463,8 +463,8 @@ pub struct BindgenContext {
has_float: Option<HashSet<ItemId>>,
}
-/// A traversal of whitelisted items.
-struct WhitelistedItemsTraversal<'ctx> {
+/// A traversal of allowlisted items.
+struct AllowlistedItemsTraversal<'ctx> {
ctx: &'ctx BindgenContext,
traversal: ItemTraversal<
'ctx,
@@ -474,14 +474,14 @@ struct WhitelistedItemsTraversal<'ctx> {
>,
}
-impl<'ctx> Iterator for WhitelistedItemsTraversal<'ctx> {
+impl<'ctx> Iterator for AllowlistedItemsTraversal<'ctx> {
type Item = ItemId;
fn next(&mut self) -> Option<ItemId> {
loop {
let id = self.traversal.next()?;
- if self.ctx.resolve_item(id).is_blacklisted(self.ctx) {
+ if self.ctx.resolve_item(id).is_blocklisted(self.ctx) {
continue;
}
@@ -490,8 +490,8 @@ impl<'ctx> Iterator for WhitelistedItemsTraversal<'ctx> {
}
}
-impl<'ctx> WhitelistedItemsTraversal<'ctx> {
- /// Construct a new whitelisted items traversal.
+impl<'ctx> AllowlistedItemsTraversal<'ctx> {
+ /// Construct a new allowlisted items traversal.
pub fn new<R>(
ctx: &'ctx BindgenContext,
roots: R,
@@ -500,7 +500,7 @@ impl<'ctx> WhitelistedItemsTraversal<'ctx> {
where
R: IntoIterator<Item = ItemId>,
{
- WhitelistedItemsTraversal {
+ AllowlistedItemsTraversal {
ctx,
traversal: ItemTraversal::new(ctx, roots, predicate),
}
@@ -559,7 +559,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
target_info,
options,
generated_bindgen_complex: Cell::new(false),
- whitelisted: None,
+ allowlisted: None,
codegen_items: None,
used_template_parameters: None,
need_bitfield_allocation: Default::default(),
@@ -718,8 +718,8 @@ If you encounter an error missing from this list, please file an issue or a PR!"
}
/// Ensure that every item (other than the root module) is in a module's
- /// children list. This is to make sure that every whitelisted item get's
- /// codegen'd, even if its parent is not whitelisted. See issue #769 for
+ /// children list. This is to make sure that every allowlisted item get's
+ /// codegen'd, even if its parent is not allowlisted. See issue #769 for
/// details.
fn add_item_to_module(&mut self, item: &Item) {
assert!(item.id() != self.root_module);
@@ -1024,7 +1024,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
_ => continue,
}
- let path = item.path_for_whitelisting(self);
+ let path = item.path_for_allowlisting(self);
let replacement = self.replacements.get(&path[1..]);
if let Some(replacement) = replacement {
@@ -1134,10 +1134,10 @@ If you encounter an error missing from this list, please file an issue or a PR!"
self.assert_no_dangling_references();
- // Compute the whitelisted set after processing replacements and
+ // Compute the allowlisted set after processing replacements and
// resolving type refs, as those are the final mutations of the IR
// graph, and their completion means that the IR graph is now frozen.
- self.compute_whitelisted_and_codegen_items();
+ self.compute_allowlisted_and_codegen_items();
// Make sure to do this after processing replacements, since that messes
// with the parentage and module children, and we want to assert that it
@@ -1293,14 +1293,14 @@ If you encounter an error missing from this list, please file an issue or a PR!"
fn find_used_template_parameters(&mut self) {
let _t = self.timer("find_used_template_parameters");
- if self.options.whitelist_recursively {
+ if self.options.allowlist_recursively {
let used_params = analyze::<UsedTemplateParameters>(self);
self.used_template_parameters = Some(used_params);
} else {
- // If you aren't recursively whitelisting, then we can't really make
+ // If you aren't recursively allowlisting, then we can't really make
// any sense of template parameter usage, and you're on your own.
let mut used_params = HashMap::default();
- for &id in self.whitelisted_items() {
+ for &id in self.allowlisted_items() {
used_params.entry(id).or_insert(
id.self_template_params(self)
.into_iter()
@@ -1319,9 +1319,9 @@ If you encounter an error missing from this list, please file an issue or a PR!"
/// template usage information is only computed as we enter the codegen
/// phase.
///
- /// If the item is blacklisted, then we say that it always uses the template
+ /// If the item is blocklisted, then we say that it always uses the template
/// parameter. This is a little subtle. The template parameter usage
- /// analysis only considers whitelisted items, and if any blacklisted item
+ /// analysis only considers allowlisted items, and if any blocklisted item
/// shows up in the generated bindings, it is the user's responsibility to
/// manually provide a definition for them. To give them the most
/// flexibility when doing that, we assume that they use every template
@@ -1336,7 +1336,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
"We only compute template parameter usage as we enter codegen"
);
- if self.resolve_item(item).is_blacklisted(self) {
+ if self.resolve_item(item).is_blocklisted(self) {
return true;
}
@@ -2194,15 +2194,15 @@ If you encounter an error missing from this list, please file an issue or a PR!"
self.current_module = previous_id;
}
- /// Iterate over all (explicitly or transitively) whitelisted items.
+ /// Iterate over all (explicitly or transitively) allowlisted items.
///
- /// If no items are explicitly whitelisted, then all items are considered
- /// whitelisted.
- pub fn whitelisted_items(&self) -> &ItemSet {
+ /// If no items are explicitly allowlisted, then all items are considered
+ /// allowlisted.
+ pub fn allowlisted_items(&self) -> &ItemSet {
assert!(self.in_codegen_phase());
assert!(self.current_module == self.root_module);
- self.whitelisted.as_ref().unwrap()
+ self.allowlisted.as_ref().unwrap()
}
/// Get a reference to the set of items we should generate.
@@ -2212,12 +2212,12 @@ If you encounter an error missing from this list, please file an issue or a PR!"
self.codegen_items.as_ref().unwrap()
}
- /// Compute the whitelisted items set and populate `self.whitelisted`.
- fn compute_whitelisted_and_codegen_items(&mut self) {
+ /// Compute the allowlisted items set and populate `self.allowlisted`.
+ fn compute_allowlisted_and_codegen_items(&mut self) {
assert!(self.in_codegen_phase());
assert!(self.current_module == self.root_module);
- assert!(self.whitelisted.is_none());
- let _t = self.timer("compute_whitelisted_and_codegen_items");
+ assert!(self.allowlisted.is_none());
+ let _t = self.timer("compute_allowlisted_and_codegen_items");
let roots = {
let mut roots = self
@@ -2225,11 +2225,11 @@ If you encounter an error missing from this list, please file an issue or a PR!"
// Only consider roots that are enabled for codegen.
.filter(|&(_, item)| item.is_enabled_for_codegen(self))
.filter(|&(_, item)| {
- // If nothing is explicitly whitelisted, then everything is fair
+ // If nothing is explicitly allowlisted, then everything is fair
// game.
- if self.options().whitelisted_types.is_empty() &&
- self.options().whitelisted_functions.is_empty() &&
- self.options().whitelisted_vars.is_empty()
+ if self.options().allowlisted_types.is_empty() &&
+ self.options().allowlisted_functions.is_empty() &&
+ self.options().allowlisted_vars.is_empty()
{
return true;
}
@@ -2240,25 +2240,25 @@ If you encounter an error missing from this list, please file an issue or a PR!"
return true;
}
- let name = item.path_for_whitelisting(self)[1..].join("::");
- debug!("whitelisted_items: testing {:?}", name);
+ let name = item.path_for_allowlisting(self)[1..].join("::");
+ debug!("allowlisted_items: testing {:?}", name);
match *item.kind() {
ItemKind::Module(..) => true,
ItemKind::Function(_) => {
- self.options().whitelisted_functions.matches(&name)
+ self.options().allowlisted_functions.matches(&name)
}
ItemKind::Var(_) => {
- self.options().whitelisted_vars.matches(&name)
+ self.options().allowlisted_vars.matches(&name)
}
ItemKind::Type(ref ty) => {
- if self.options().whitelisted_types.matches(&name) {
+ if self.options().allowlisted_types.matches(&name) {
return true;
}
- // Auto-whitelist types that don't need code
- // generation if not whitelisting recursively, to
+ // Auto-allowlist types that don't need code
+ // generation if not allowlisting recursively, to
// make the #[derive] analysis not be lame.
- if !self.options().whitelist_recursively {
+ if !self.options().allowlist_recursively {
match *ty.kind() {
TypeKind::Void |
TypeKind::NullPtr |
@@ -2278,7 +2278,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
}
// Unnamed top-level enums are special and we
- // whitelist them via the `whitelisted_vars` filter,
+ // allowlist them via the `allowlisted_vars` filter,
// since they're effectively top-level constants,
// and there's no way for them to be referenced
// consistently.
@@ -2297,12 +2297,12 @@ If you encounter an error missing from this list, please file an issue or a PR!"
}
let mut prefix_path =
- parent.path_for_whitelisting(self).clone();
+ parent.path_for_allowlisting(self).clone();
enum_.variants().iter().any(|variant| {
prefix_path.push(variant.name().into());
let name = prefix_path[1..].join("::");
prefix_path.pop().unwrap();
- self.options().whitelisted_vars.matches(&name)
+ self.options().allowlisted_vars.matches(&name)
})
}
}
@@ -2317,48 +2317,48 @@ If you encounter an error missing from this list, please file an issue or a PR!"
roots
};
- let whitelisted_items_predicate =
- if self.options().whitelist_recursively {
+ let allowlisted_items_predicate =
+ if self.options().allowlist_recursively {
traversal::all_edges
} else {
- // Only follow InnerType edges from the whitelisted roots.
+ // Only follow InnerType edges from the allowlisted roots.
// Such inner types (e.g. anonymous structs/unions) are
- // always emitted by codegen, and they need to be whitelisted
+ // always emitted by codegen, and they need to be allowlisted
// to make sure they are processed by e.g. the derive analysis.
traversal::only_inner_type_edges
};
- let whitelisted = WhitelistedItemsTraversal::new(
+ let allowlisted = AllowlistedItemsTraversal::new(
self,
roots.clone(),
- whitelisted_items_predicate,
+ allowlisted_items_predicate,
)
.collect::<ItemSet>();
- let codegen_items = if self.options().whitelist_recursively {
- WhitelistedItemsTraversal::new(
+ let codegen_items = if self.options().allowlist_recursively {
+ AllowlistedItemsTraversal::new(
self,
roots.clone(),
traversal::codegen_edges,
)
.collect::<ItemSet>()
} else {
- whitelisted.clone()
+ allowlisted.clone()
};
- self.whitelisted = Some(whitelisted);
+ self.allowlisted = Some(allowlisted);
self.codegen_items = Some(codegen_items);
- for item in self.options().whitelisted_functions.unmatched_items() {
- warn!("unused option: --whitelist-function {}", item);
+ for item in self.options().allowlisted_functions.unmatched_items() {
+ warn!("unused option: --allowlist-function {}", item);
}
- for item in self.options().whitelisted_vars.unmatched_items() {
- warn!("unused option: --whitelist-var {}", item);
+ for item in self.options().allowlisted_vars.unmatched_items() {
+ warn!("unused option: --allowlist-var {}", item);
}
- for item in self.options().whitelisted_types.unmatched_items() {
- warn!("unused option: --whitelist-type {}", item);
+ for item in self.options().allowlisted_types.unmatched_items() {
+ warn!("unused option: --allowlist-type {}", item);
}
}
@@ -2575,31 +2575,31 @@ If you encounter an error missing from this list, please file an issue or a PR!"
/// Check if `--no-partialeq` flag is enabled for this item.
pub fn no_partialeq_by_name(&self, item: &Item) -> bool {
- let name = item.path_for_whitelisting(self)[1..].join("::");
+ let name = item.path_for_allowlisting(self)[1..].join("::");
self.options().no_partialeq_types.matches(&name)
}
/// Check if `--no-copy` flag is enabled for this item.
pub fn no_copy_by_name(&self, item: &Item) -> bool {
- let name = item.path_for_whitelisting(self)[1..].join("::");
+ let name = item.path_for_allowlisting(self)[1..].join("::");
self.options().no_copy_types.matches(&name)
}
/// Check if `--no-debug` flag is enabled for this item.
pub fn no_debug_by_name(&self, item: &Item) -> bool {
- let name = item.path_for_whitelisting(self)[1..].join("::");
+ let name = item.path_for_allowlisting(self)[1..].join("::");
self.options().no_debug_types.matches(&name)
}
/// Check if `--no-default` flag is enabled for this item.
pub fn no_default_by_name(&self, item: &Item) -> bool {
- let name = item.path_for_whitelisting(self)[1..].join("::");
+ let name = item.path_for_allowlisting(self)[1..].join("::");
self.options().no_default_types.matches(&name)
}
/// Check if `--no-hash` flag is enabled for this item.
pub fn no_hash_by_name(&self, item: &Item) -> bool {
- let name = item.path_for_whitelisting(self)[1..].join("::");
+ let name = item.path_for_allowlisting(self)[1..].join("::");
self.options().no_hash_types.matches(&name)
}
}
diff --git a/src/ir/dot.rs b/src/ir/dot.rs
index 6bf75bfa..f7d07f19 100644
--- a/src/ir/dot.rs
+++ b/src/ir/dot.rs
@@ -32,13 +32,13 @@ where
let mut err: Option<io::Result<_>> = None;
for (id, item) in ctx.items() {
- let is_whitelisted = ctx.whitelisted_items().contains(&id);
+ let is_allowlisted = ctx.allowlisted_items().contains(&id);
writeln!(
&mut dot_file,
r#"{} [fontname="courier", color={}, label=< <table border="0" align="left">"#,
id.as_usize(),
- if is_whitelisted { "black" } else { "gray" }
+ if is_allowlisted { "black" } else { "gray" }
)?;
item.dot_attributes(ctx, &mut dot_file)?;
writeln!(&mut dot_file, r#"</table> >];"#)?;
@@ -56,7 +56,7 @@ where
id.as_usize(),
sub_id.as_usize(),
edge_kind,
- if is_whitelisted { "black" } else { "gray" }
+ if is_allowlisted { "black" } else { "gray" }
) {
Ok(_) => {}
Err(e) => err = Some(Err(e)),
diff --git a/src/ir/enum_ty.rs b/src/ir/enum_ty.rs
index dde4bb18..c6cd89ce 100644
--- a/src/ir/enum_ty.rs
+++ b/src/ir/enum_ty.rs
@@ -152,7 +152,7 @@ impl Enum {
enums: &RegexSet,
item: &Item,
) -> bool {
- let path = item.path_for_whitelisting(ctx);
+ let path = item.path_for_allowlisting(ctx);
let enum_ty = item.expect_type();
if enums.matches(&path[1..].join("::")) {
diff --git a/src/ir/item.rs b/src/ir/item.rs
index e9abed70..45415045 100644
--- a/src/ir/item.rs
+++ b/src/ir/item.rs
@@ -273,10 +273,10 @@ impl Trace for Item {
where
T: Tracer,
{
- // Even if this item is blacklisted/hidden, we want to trace it. It is
+ // Even if this item is blocklisted/hidden, we want to trace it. It is
// traversal iterators' consumers' responsibility to filter items as
// needed. Generally, this filtering happens in the implementation of
- // `Iterator` for `WhitelistedItems`. Fully tracing blacklisted items is
+ // `Iterator` for `allowlistedItems`. Fully tracing blocklisted items is
// necessary for things like the template parameter usage analysis to
// function correctly.
@@ -301,12 +301,12 @@ impl Trace for Item {
}
ItemKind::Module(_) => {
// Module -> children edges are "weak", and we do not want to
- // trace them. If we did, then whitelisting wouldn't work as
+ // trace them. If we did, then allowlisting wouldn't work as
// expected: everything in every module would end up
- // whitelisted.
+ // allowlisted.
//
// TODO: make a new edge kind for module -> children edges and
- // filter them during whitelisting traversals.
+ // filter them during allowlisting traversals.
}
}
}
@@ -400,9 +400,9 @@ pub struct Item {
/// considerably faster in those cases.
canonical_name: LazyCell<String>,
- /// The path to use for whitelisting and other name-based checks, as
- /// returned by `path_for_whitelisting`, lazily constructed.
- path_for_whitelisting: LazyCell<Vec<String>>,
+ /// The path to use for allowlisting and other name-based checks, as
+ /// returned by `path_for_allowlisting`, lazily constructed.
+ path_for_allowlisting: LazyCell<Vec<String>>,
/// A doc comment over the item, if any.
comment: Option<String>,
@@ -440,7 +440,7 @@ impl Item {
local_id: LazyCell::new(),
next_child_local_id: Cell::new(1),
canonical_name: LazyCell::new(),
- path_for_whitelisting: LazyCell::new(),
+ path_for_allowlisting: LazyCell::new(),
parent_id: parent_id,
comment: comment,
annotations: annotations.unwrap_or_default(),
@@ -623,10 +623,10 @@ impl Item {
&self.annotations
}
- /// Whether this item should be blacklisted.
+ /// Whether this item should be blocklisted.
///
/// This may be due to either annotations or to other kind of configuration.
- pub fn is_blacklisted(&self, ctx: &BindgenContext) -> bool {
+ pub fn is_blocklisted(&self, ctx: &BindgenContext) -> bool {
debug_assert!(
ctx.in_codegen_phase(),
"You're not supposed to call this yet"
@@ -635,18 +635,18 @@ impl Item {
return true;
}
- let path = self.path_for_whitelisting(ctx);
+ let path = self.path_for_allowlisting(ctx);
let name = path[1..].join("::");
- ctx.options().blacklisted_items.matches(&name) ||
+ ctx.options().blocklisted_items.matches(&name) ||
match self.kind {
ItemKind::Type(..) => {
- ctx.options().blacklisted_types.matches(&name) ||
+ ctx.options().blocklisted_types.matches(&name) ||
ctx.is_replaced_type(&path, self.id)
}
ItemKind::Function(..) => {
- ctx.options().blacklisted_functions.matches(&name)
+ ctx.options().blocklisted_functions.matches(&name)
}
- // TODO: Add constant / namespace blacklisting?
+ // TODO: Add constant / namespace blocklisting?
ItemKind::Var(..) | ItemKind::Module(..) => false,
}
}
@@ -1012,10 +1012,10 @@ impl Item {
}
}
- /// Returns the path we should use for whitelisting / blacklisting, which
+ /// Returns the path we should use for allowlisting / blocklisting, which
/// doesn't include user-mangling.
- pub fn path_for_whitelisting(&self, ctx: &BindgenContext) -> &Vec<String> {
- self.path_for_whitelisting
+ pub fn path_for_allowlisting(&self, ctx: &BindgenContext) -> &Vec<String> {
+ self.path_for_allowlisting
.borrow_with(|| self.compute_path(ctx, UserMangled::No))
}
@@ -1081,7 +1081,7 @@ impl IsOpaque for Item {
);
self.annotations.opaque() ||
self.as_type().map_or(false, |ty| ty.is_opaque(ctx, self)) ||
- ctx.opaque_by_name(&self.path_for_whitelisting(ctx))
+ ctx.opaque_by_name(&self.path_for_allowlisting(ctx))
}
}
@@ -1390,7 +1390,7 @@ impl ClangItemParser for Item {
if cursor.kind() == CXCursor_UnexposedDecl {
Err(ParseError::Recurse)
} else {
- // We whitelist cursors here known to be unhandled, to prevent being
+ // We allowlist cursors here known to be unhandled, to prevent being
// too noisy about this.
match cursor.kind() {
CXCursor_MacroDefinition |
@@ -1918,7 +1918,7 @@ impl ItemCanonicalPath for Item {
/// not.
///
/// Most of the callers probably want just yes, but the ones dealing with
-/// whitelisting and blacklisting don't.
+/// allowlisting and blocklisting don't.
#[derive(Copy, Clone, Debug, PartialEq)]
enum UserMangled {
No,
diff --git a/src/ir/template.rs b/src/ir/template.rs
index 8c625d1d..b519fff1 100644
--- a/src/ir/template.rs
+++ b/src/ir/template.rs
@@ -306,13 +306,13 @@ impl IsOpaque for TemplateInstantiation {
// correct fix is to make `canonical_{name,path}` include template
// arguments properly.
- let mut path = item.path_for_whitelisting(ctx).clone();
+ let mut path = item.path_for_allowlisting(ctx).clone();
let args: Vec<_> = self
.template_arguments()
.iter()
.map(|arg| {
let arg_path =
- ctx.resolve_item(*arg).path_for_whitelisting(ctx);
+ ctx.resolve_item(*arg).path_for_allowlisting(ctx);
arg_path[1..].join("::")
})
.collect();
diff --git a/src/ir/traversal.rs b/src/ir/traversal.rs
index e4a44703..430dd027 100644
--- a/src/ir/traversal.rs
+++ b/src/ir/traversal.rs
@@ -201,7 +201,7 @@ pub fn all_edges(_: &BindgenContext, _: Edge) -> bool {
/// A `TraversalPredicate` implementation that only follows
/// `EdgeKind::InnerType` edges, and therefore traversals using this predicate
/// will only visit the traversal's roots and their inner types. This is used
-/// in no-recursive-whitelist mode, where inner types such as anonymous
+/// in no-recursive-allowlist mode, where inner types such as anonymous
/// structs/unions still need to be processed.
pub fn only_inner_type_edges(_: &BindgenContext, edge: Edge) -> bool {
edge.kind == EdgeKind::InnerType
@@ -377,7 +377,7 @@ pub trait Trace {
/// An graph traversal of the transitive closure of references between items.
///
-/// See `BindgenContext::whitelisted_items` for more information.
+/// See `BindgenContext::allowlisted_items` for more information.
pub struct ItemTraversal<'ctx, Storage, Queue, Predicate>
where
Storage: TraversalStorage<'ctx>,
diff --git a/src/lib.rs b/src/lib.rs
index 06ba8e63..945d3065 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -177,8 +177,8 @@ impl Default for CodegenConfig {
///
/// // Configure and generate bindings.
/// let bindings = builder().header("path/to/input/header")
-/// .whitelist_type("SomeCoolClass")
-/// .whitelist_function("do_some_cool_thing")
+/// .allowlist_type("SomeCoolClass")
+/// .allowlist_function("do_some_cool_thing")
/// .generate()?;
///
/// // Write the generated bindings to an output file.
@@ -304,13 +304,13 @@ impl Builder {
(&self.options.type_alias, "--type-alias"),
(&self.options.new_type_alias, "--new-type-alias"),
(&self.options.new_type_alias_deref, "--new-type-alias-deref"),
- (&self.options.blacklisted_types, "--blacklist-type"),
- (&self.options.blacklisted_functions, "--blacklist-function"),
- (&self.options.blacklisted_items, "--blacklist-item"),
+ (&self.options.blocklisted_types, "--blocklist-type"),
+ (&self.options.blocklisted_functions, "--blocklist-function"),
+ (&self.options.blocklisted_items, "--blocklist-item"),
(&self.options.opaque_types, "--opaque-type"),
- (&self.options.whitelisted_functions, "--whitelist-function"),
- (&self.options.whitelisted_types, "--whitelist-type"),
- (&self.options.whitelisted_vars, "--whitelist-var"),
+ (&self.options.allowlisted_functions, "--allowlist-function"),
+ (&self.options.allowlisted_types, "--allowlist-type"),
+ (&self.options.allowlisted_vars, "--allowlist-var"),
(&self.options.no_partialeq_types, "--no-partialeq"),
(&self.options.no_copy_types, "--no-copy"),
(&self.options.no_debug_types, "--no-debug"),
@@ -379,8 +379,8 @@ impl Builder {
output_vector.push("--no-doc-comments".into());
}
- if !self.options.whitelist_recursively {
- output_vector.push("--no-recursive-whitelist".into());
+ if !self.options.allowlist_recursively {
+ output_vector.push("--no-recursive-allowlist".into());
}
if self.options.objc_extern_crate {
@@ -661,9 +661,9 @@ impl Builder {
self
}
- /// Whether to whitelist recursively or not. Defaults to true.
+ /// Whether to allowlist recursively or not. Defaults to true.
///
- /// Given that we have explicitly whitelisted the "initiate_dance_party"
+ /// Given that we have explicitly allowlisted the "initiate_dance_party"
/// function in this C header:
///
/// ```c
@@ -676,20 +676,20 @@ impl Builder {
///
/// We would normally generate bindings to both the `initiate_dance_party`
/// function and the `MoonBoots` struct that it transitively references. By
- /// configuring with `whitelist_recursively(false)`, `bindgen` will not emit
- /// bindings for anything except the explicitly whitelisted items, and there
+ /// configuring with `allowlist_recursively(false)`, `bindgen` will not emit
+ /// bindings for anything except the explicitly allowlisted items, and there
/// would be no emitted struct definition for `MoonBoots`. However, the
/// `initiate_dance_party` function would still reference `MoonBoots`!
///
/// **Disabling this feature will almost certainly cause `bindgen` to emit
/// bindings that will not compile!** If you disable this feature, then it
/// is *your* responsibility to provide definitions for every type that is
- /// referenced from an explicitly whitelisted item. One way to provide the
+ /// referenced from an explicitly allowlisted item. One way to provide the
/// definitions is by using the [`Builder::raw_line`](#method.raw_line)
/// method, another would be to define them in Rust and then `include!(...)`
/// the bindings immediately afterwards.
- pub fn whitelist_recursively(mut self, doit: bool) -> Self {
- self.options.whitelist_recursively = doit;
+ pub fn allowlist_recursively(mut self, doit: bool) -> Self {
+ self.options.allowlist_recursively = doit;
self
}
@@ -727,30 +727,53 @@ impl Builder {
/// Hide the given type from the generated bindings. Regular expressions are
/// supported.
- #[deprecated(note = "Use blacklist_type instead")]
+ #[deprecated(note = "Use blocklist_type instead")]
pub fn hide_type<T: AsRef<str>>(self, arg: T) -> Builder {
- self.blacklist_type(arg)
+ self.blocklist_type(arg)
+ }
+
+ /// Hide the given type from the generated bindings. Regular expressions are
+ /// supported.
+ #[deprecated(note = "Use blocklist_type instead")]
+ pub fn blacklist_type<T: AsRef<str>>(self, arg: T) -> Builder {
+ self.blocklist_type(arg)
}
/// Hide the given type from the generated bindings. Regular expressions are
/// supported.
///
- /// To blacklist types prefixed with "mylib" use `"mylib_.*"`.
+ /// To blocklist types prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
- pub fn blacklist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
- self.options.blacklisted_types.insert(arg);
+ pub fn blocklist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
+ self.options.blocklisted_types.insert(arg);
self
}
/// Hide the given function from the generated bindings. Regular expressions
/// are supported.
+ #[deprecated(note = "Use blocklist_function instead")]
+ pub fn blacklist_function<T: AsRef<str>>(self, arg: T) -> Builder {
+ self.blocklist_function(arg)
+ }
+
+ /// Hide the given function from the generated bindings. Regular expressions
+ /// are supported.
///
- /// To blacklist functions prefixed with "mylib" use `"mylib_.*"`.
+ /// To blocklist functions prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
- pub fn blacklist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
- self.options.blacklisted_functions.insert(arg);
+ pub fn blocklist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
+ self.options.blocklisted_functions.insert(arg);
+ self
+ }
+
+ /// Hide the given item from the generated bindings, regardless of
+ /// whether it's a type, function, module, etc. Regular
+ /// expressions are supported.
+ #[deprecated(note = "Use blocklist_item instead")]
+ pub fn blacklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder {
+ self.options.blocklisted_items.insert(arg);
self
}
@@ -758,11 +781,11 @@ impl Builder {
/// whether it's a type, function, module, etc. Regular
/// expressions are supported.
///
- /// To blacklist items prefixed with "mylib" use `"mylib_.*"`.
+ /// To blocklist items prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
- pub fn blacklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder {
- self.options.blacklisted_items.insert(arg);
+ pub fn blocklist_item<T: AsRef<str>>(mut self, arg: T) -> Builder {
+ self.options.blocklisted_items.insert(arg);
self
}
@@ -777,64 +800,86 @@ impl Builder {
self
}
- /// Whitelist the given type so that it (and all types that it transitively
+ /// Allowlist the given type so that it (and all types that it transitively
/// refers to) appears in the generated bindings. Regular expressions are
/// supported.
- #[deprecated(note = "use whitelist_type instead")]
+ #[deprecated(note = "use allowlist_type instead")]
pub fn whitelisted_type<T: AsRef<str>>(self, arg: T) -> Builder {
- self.whitelist_type(arg)
+ self.allowlist_type(arg)
+ }
+
+ /// Allowlist the given type so that it (and all types that it transitively
+ /// refers to) appears in the generated bindings. Regular expressions are
+ /// supported.
+ #[deprecated(note = "use allowlist_type instead")]
+ pub fn whitelist_type<T: AsRef<str>>(self, arg: T) -> Builder {
+ self.allowlist_type(arg)
}
- /// Whitelist the given type so that it (and all types that it transitively
+ /// Allowlist the given type so that it (and all types that it transitively
/// refers to) appears in the generated bindings. Regular expressions are
/// supported.
///
- /// To whitelist types prefixed with "mylib" use `"mylib_.*"`.
+ /// To allowlist types prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
- pub fn whitelist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
- self.options.whitelisted_types.insert(arg);
+ pub fn allowlist_type<T: AsRef<str>>(mut self, arg: T) -> Builder {
+ self.options.allowlisted_types.insert(arg);
self
}
- /// Whitelist the given function so that it (and all types that it
+ /// Allowlist the given function so that it (and all types that it
/// transitively refers to) appears in the generated bindings. Regular
/// expressions are supported.
///
- /// To whitelist functions prefixed with "mylib" use `"mylib_.*"`.
+ /// To allowlist functions prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
- pub fn whitelist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
- self.options.whitelisted_functions.insert(arg);
+ pub fn allowlist_function<T: AsRef<str>>(mut self, arg: T) -> Builder {
+ self.options.allowlisted_functions.insert(arg);
self
}
- /// Whitelist the given function.
+ /// Allowlist the given function.
+ ///
+ /// Deprecated: use allowlist_function instead.
+ #[deprecated(note = "use allowlist_function instead")]
+ pub fn whitelist_function<T: AsRef<str>>(self, arg: T) -> Builder {
+ self.allowlist_function(arg)
+ }
+
+ /// Allowlist the given function.
///
- /// Deprecated: use whitelist_function instead.
- #[deprecated(note = "use whitelist_function instead")]
+ /// Deprecated: use allowlist_function instead.
+ #[deprecated(note = "use allowlist_function instead")]
pub fn whitelisted_function<T: AsRef<str>>(self, arg: T) -> Builder {
- self.whitelist_function(arg)
+ self.allowlist_function(arg)
}
- /// Whitelist the given variable so that it (and all types that it
+ /// Allowlist the given variable so that it (and all types that it
/// transitively refers to) appears in the generated bindings. Regular
/// expressions are supported.
///
- /// To whitelist variables prefixed with "mylib" use `"mylib_.*"`.
+ /// To allowlist variables prefixed with "mylib" use `"mylib_.*"`.
/// For more complicated expressions check
/// [regex](https://docs.rs/regex/*/regex/) docs
- pub fn whitelist_var<T: AsRef<str>>(mut self, arg: T) -> Builder {
- self.options.whitelisted_vars.insert(arg);
+ pub fn allowlist_var<T: AsRef<str>>(mut self, arg: T) -> Builder {
+ self.options.allowlisted_vars.insert(arg);
self
}
- /// Whitelist the given variable.
+ /// Deprecated: use allowlist_var instead.
+ #[deprecated(note = "use allowlist_var instead")]
+ pub fn whitelist_var<T: AsRef<str>>(self, arg: T) -> Builder {
+ self.allowlist_var(arg)
+ }
+
+ /// Allowlist the given variable.
///
- /// Deprecated: use whitelist_var instead.
- #[deprecated(note = "use whitelist_var instead")]
+ /// Deprecated: use allowlist_var instead.
+ #[deprecated(note = "use allowlist_var instead")]
pub fn whitelisted_var<T: AsRef<str>>(self, arg: T) -> Builder {
- self.whitelist_var(arg)
+ self.allowlist_var(arg)
}
/// Set the default style of code to generate for enums
@@ -1163,7 +1208,7 @@ impl Builder {
/// This method disables that behavior.
///
/// Note that this intentionally does not change the names used for
- /// whitelisting and blacklisting, which should still be mangled with the
+ /// allowlisting and blocklisting, which should still be mangled with the
/// namespaces.
///
/// Note, also, that this option may cause bindgen to generate duplicate
@@ -1533,17 +1578,17 @@ impl Builder {
/// Configuration options for generated bindings.
#[derive(Debug)]
struct BindgenOptions {
- /// The set of types that have been blacklisted and should not appear
+ /// The set of types that have been blocklisted and should not appear
/// anywhere in the generated code.
- blacklisted_types: RegexSet,
+ blocklisted_types: RegexSet,
- /// The set of functions that have been blacklisted and should not appear
+ /// The set of functions that have been blocklisted and should not appear
/// in the generated code.
- blacklisted_functions: RegexSet,
+ blocklisted_functions: RegexSet,
/// The set of items, regardless of item-type, that have been
- /// blacklisted and should not appear in the generated code.
- blacklisted_items: RegexSet,
+ /// blocklisted and should not appear in the generated code.
+ blocklisted_items: RegexSet,
/// The set of types that should be treated as opaque structures in the
/// generated code.
@@ -1556,15 +1601,15 @@ struct BindgenOptions {
/// code.
///
/// This includes all types transitively reachable from any type in this
- /// set. One might think of whitelisted types/vars/functions as GC roots,
+ /// set. One might think of allowlisted types/vars/functions as GC roots,
/// and the generated Rust code as including everything that gets marked.
- whitelisted_types: RegexSet,
+ allowlisted_types: RegexSet,
- /// Whitelisted functions. See docs for `whitelisted_types` for more.
- whitelisted_functions: RegexSet,
+ /// Allowlisted functions. See docs for `allowlisted_types` for more.
+ allowlisted_functions: RegexSet,
- /// Whitelisted variables. See docs for `whitelisted_types` for more.
- whitelisted_vars: RegexSet,
+ /// Allowlisted variables. See docs for `allowlisted_types` for more.
+ allowlisted_vars: RegexSet,
/// The default style of code to generate for enums
default_enum_style: codegen::EnumVariation,
@@ -1736,8 +1781,8 @@ struct BindgenOptions {
/// Whether to generate inline functions. Defaults to false.
generate_inline_functions: bool,
- /// Whether to whitelist types recursively. Defaults to true.
- whitelist_recursively: bool,
+ /// Whether to allowlist types recursively. Defaults to true.
+ allowlist_recursively: bool,
/// Instead of emitting 'use objc;' to files generated from objective c files,
/// generate '#[macro_use] extern crate objc;'
@@ -1777,7 +1822,7 @@ struct BindgenOptions {
/// Whether we should record which items in the regex sets ever matched.
///
- /// This may be a bit slower, but will enable reporting of unused whitelist
+ /// This may be a bit slower, but will enable reporting of unused allowlist
/// items via the `error!` log.
record_matches: bool,
@@ -1829,12 +1874,12 @@ impl ::std::panic::UnwindSafe for BindgenOptions {}
impl BindgenOptions {
fn build(&mut self) {
let mut regex_sets = [
- &mut self.whitelisted_vars,
- &mut self.whitelisted_types,
- &mut self.whitelisted_functions,
- &mut self.blacklisted_types,
- &mut self.blacklisted_functions,
- &mut self.blacklisted_items,
+ &mut self.allowlisted_vars,
+ &mut self.allowlisted_types,
+ &mut self.allowlisted_functions,
+ &mut self.blocklisted_types,
+ &mut self.blocklisted_functions,
+ &mut self.blocklisted_items,
&mut self.opaque_types,
&mut self.bitfield_enums,
&mut self.constified_enums,
@@ -1878,14 +1923,14 @@ impl Default for BindgenOptions {
BindgenOptions {
rust_target,
rust_features: rust_target.into(),
- blacklisted_types: Default::default(),
- blacklisted_functions: Default::default(),
- blacklisted_items: Default::default(),
+ blocklisted_types: Default::default(),
+ blocklisted_functions: Default::default(),
+ blocklisted_items: Default::default(),
opaque_types: Default::default(),
rustfmt_path: Default::default(),
- whitelisted_types: Default::default(),
- whitelisted_functions: Default::default(),
- whitelisted_vars: Default::default(),
+ allowlisted_types: Default::default(),
+ allowlisted_functions: Default::default(),
+ allowlisted_vars: Default::default(),
default_enum_style: Default::default(),
bitfield_enums: Default::default(),
newtype_enums: Default::default(),
@@ -1934,7 +1979,7 @@ impl Default for BindgenOptions {
conservative_inline_namespaces: false,
generate_comments: true,
generate_inline_functions: false,
- whitelist_recursively: true,
+ allowlist_recursively: true,
generate_block: false,
objc_extern_crate: false,
block_extern_crate: false,
@@ -2520,8 +2565,8 @@ fn commandline_flag_unit_test_function() {
//Test 2
let bindings = crate::builder()
.header("input_header")
- .whitelist_type("Distinct_Type")
- .whitelist_function("safe_function");
+ .allowlist_type("Distinct_Type")
+ .allowlist_function("safe_function");
let command_line_flags = bindings.command_line_flags();
let test_cases = vec![
@@ -2530,9 +2575,9 @@ fn commandline_flag_unit_test_function() {
"--no-derive-default",
"--generate",
"functions,types,vars,methods,constructors,destructors",
- "--whitelist-type",
+ "--allowlist-type",
"Distinct_Type",
- "--whitelist-function",
+ "--allowlist-function",
"safe_function",
]
.iter()
diff --git a/src/options.rs b/src/options.rs
index 63e48dc8..2289ad09 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -136,22 +136,25 @@ where
.takes_value(true)
.multiple(true)
.number_of_values(1),
- Arg::with_name("blacklist-type")
- .long("blacklist-type")
+ Arg::with_name("blocklist-type")
+ .alias("blacklist-type")
+ .long("blocklist-type")
.help("Mark <type> as hidden.")
.value_name("type")
.takes_value(true)
.multiple(true)
.number_of_values(1),
- Arg::with_name("blacklist-function")
- .long("blacklist-function")
+ Arg::with_name("blocklist-function")
+ .alias("blacklist-function")
+ .long("blocklist-function")
.help("Mark <function> as hidden.")
.value_name("function")
.takes_value(true)
.multiple(true)
.number_of_values(1),
- Arg::with_name("blacklist-item")
- .long("blacklist-item")
+ Arg::with_name("blocklist-item")
+ .alias("blacklist-item")
+ .long("blocklist-item")
.help("Mark <item> as hidden.")
.value_name("item")
.takes_value(true)
@@ -210,12 +213,13 @@ where
"Avoid including doc comments in the output, see: \
https://github.com/rust-lang/rust-bindgen/issues/426",
),
- Arg::with_name("no-recursive-whitelist")
- .long("no-recursive-whitelist")
+ Arg::with_name("no-recursive-allowlist")
+ .long("no-recursive-allowlist")
+ .alias("no-recursive-whitelist")
.help(
- "Disable whitelisting types recursively. This will cause \
+ "Disable allowlisting types recursively. This will cause \
bindgen to emit Rust code that won't compile! See the \
- `bindgen::Builder::whitelist_recursively` method's \
+ `bindgen::Builder::allowlist_recursively` method's \
documentation for details.",
),
Arg::with_name("objc-extern-crate")
@@ -364,11 +368,12 @@ where
Arg::with_name("use-msvc-mangling")
.long("use-msvc-mangling")
.help("MSVC C++ ABI mangling. DEPRECATED: Has no effect."),
- Arg::with_name("whitelist-function")
- .long("whitelist-function")
+ Arg::with_name("allowlist-function")
+ .long("allowlist-function")
+ .alias("whitelist-function")
.help(
- "Whitelist all the free-standing functions matching \
- <regex>. Other non-whitelisted functions will not be \
+ "Allowlist all the free-standing functions matching \
+ <regex>. Other non-allowlisted functions will not be \
generated.",
)
.value_name("regex")
@@ -378,21 +383,23 @@ where
Arg::with_name("generate-inline-functions")
.long("generate-inline-functions")
.help("Generate inline functions."),
- Arg::with_name("whitelist-type")
- .long("whitelist-type")
+ Arg::with_name("allowlist-type")
+ .long("allowlist-type")
+ .alias("whitelist-type")
.help(
- "Only generate types matching <regex>. Other non-whitelisted types will \
+ "Only generate types matching <regex>. Other non-allowlisted types will \
not be generated.",
)
.value_name("regex")
.takes_value(true)
.multiple(true)
.number_of_values(1),
- Arg::with_name("whitelist-var")
- .long("whitelist-var")
+ Arg::with_name("allowlist-var")
+ .long("allowlist-var")
+ .alias("whitelist-var")
.help(
- "Whitelist all the free-standing variables matching \
- <regex>. Other non-whitelisted variables will not be \
+ "Allowlist all the free-standing variables matching \
+ <regex>. Other non-allowlisted variables will not be \
generated.",
)
.value_name("regex")
@@ -582,21 +589,21 @@ where
}
}
- if let Some(hidden_types) = matches.values_of("blacklist-type") {
+ if let Some(hidden_types) = matches.values_of("blocklist-type") {
for ty in hidden_types {
- builder = builder.blacklist_type(ty);
+ builder = builder.blocklist_type(ty);
}
}
- if let Some(hidden_functions) = matches.values_of("blacklist-function") {
+ if let Some(hidden_functions) = matches.values_of("blocklist-function") {
for fun in hidden_functions {
- builder = builder.blacklist_function(fun);
+ builder = builder.blocklist_function(fun);
}
}
- if let Some(hidden_identifiers) = matches.values_of("blacklist-item") {
+ if let Some(hidden_identifiers) = matches.values_of("blocklist-item") {
for id in hidden_identifiers {
- builder = builder.blacklist_item(id);
+ builder = builder.blocklist_item(id);
}
}
@@ -758,8 +765,8 @@ where
builder = builder.generate_comments(false);
}
- if matches.is_present("no-recursive-whitelist") {
- builder = builder.whitelist_recursively(false);
+ if matches.is_present("no-recursive-allowlist") {
+ builder = builder.allowlist_recursively(false);
}
if matches.is_present("objc-extern-crate") {
@@ -809,21 +816,21 @@ where
builder = builder.generate_inline_functions(true);
}
- if let Some(whitelist) = matches.values_of("whitelist-function") {
- for regex in whitelist {
- builder = builder.whitelist_function(regex);
+ if let Some(allowlist) = matches.values_of("allowlist-function") {
+ for regex in allowlist {
+ builder = builder.allowlist_function(regex);
}
}
- if let Some(whitelist) = matches.values_of("whitelist-type") {
- for regex in whitelist {
- builder = builder.whitelist_type(regex);
+ if let Some(allowlist) = matches.values_of("allowlist-type") {
+ for regex in allowlist {
+ builder = builder.allowlist_type(regex);
}
}
- if let Some(whitelist) = matches.values_of("whitelist-var") {
- for regex in whitelist {
- builder = builder.whitelist_var(regex);
+ if let Some(allowlist) = matches.values_of("allowlist-var") {
+ for regex in allowlist {
+ builder = builder.allowlist_var(regex);
}
}
diff --git a/tests/expectations/tests/whitelist-namespaces-basic.rs b/tests/expectations/tests/allowlist-namespaces-basic.rs
index 36d03fef..36d03fef 100644
--- a/tests/expectations/tests/whitelist-namespaces-basic.rs
+++ b/tests/expectations/tests/allowlist-namespaces-basic.rs
diff --git a/tests/expectations/tests/whitelist-namespaces.rs b/tests/expectations/tests/allowlist-namespaces.rs
index 4236f63e..4236f63e 100644
--- a/tests/expectations/tests/whitelist-namespaces.rs
+++ b/tests/expectations/tests/allowlist-namespaces.rs
diff --git a/tests/expectations/tests/whitelist_basic.rs b/tests/expectations/tests/allowlist_basic.rs
index 7806923c..4e72e8b6 100644
--- a/tests/expectations/tests/whitelist_basic.rs
+++ b/tests/expectations/tests/allowlist_basic.rs
@@ -7,23 +7,23 @@
#[repr(C)]
#[derive(Debug, Copy, Clone)]
-pub struct WhitelistMe<T> {
+pub struct AllowlistMe<T> {
pub foo: ::std::os::raw::c_int,
- pub bar: WhitelistMe_Inner<T>,
+ pub bar: AllowlistMe_Inner<T>,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
-pub struct WhitelistMe_Inner<T> {
+pub struct AllowlistMe_Inner<T> {
pub bar: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-impl<T> Default for WhitelistMe_Inner<T> {
+impl<T> Default for AllowlistMe_Inner<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
-impl<T> Default for WhitelistMe<T> {
+impl<T> Default for AllowlistMe<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
diff --git a/tests/expectations/tests/whitelist_fix.rs b/tests/expectations/tests/allowlist_fix.rs
index 9cff795b..9cff795b 100644
--- a/tests/expectations/tests/whitelist_fix.rs
+++ b/tests/expectations/tests/allowlist_fix.rs
diff --git a/tests/expectations/tests/whitelist_vars.rs b/tests/expectations/tests/allowlist_vars.rs
index 590cbafc..590cbafc 100644
--- a/tests/expectations/tests/whitelist_vars.rs
+++ b/tests/expectations/tests/allowlist_vars.rs
diff --git a/tests/expectations/tests/whitelisted-item-references-no-hash.rs b/tests/expectations/tests/allowlisted-item-references-no-hash.rs
index e1217bc5..bc3fde1d 100644
--- a/tests/expectations/tests/whitelisted-item-references-no-hash.rs
+++ b/tests/expectations/tests/allowlisted-item-references-no-hash.rs
@@ -25,29 +25,29 @@ fn bindgen_test_layout_NoHash() {
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
-pub struct WhitelistMe {
+pub struct AllowlistMe {
pub a: NoHash,
}
#[test]
-fn bindgen_test_layout_WhitelistMe() {
+fn bindgen_test_layout_AllowlistMe() {
assert_eq!(
- ::std::mem::size_of::<WhitelistMe>(),
+ ::std::mem::size_of::<AllowlistMe>(),
1usize,
- concat!("Size of: ", stringify!(WhitelistMe))
+ concat!("Size of: ", stringify!(AllowlistMe))
);
assert_eq!(
- ::std::mem::align_of::<WhitelistMe>(),
+ ::std::mem::align_of::<AllowlistMe>(),
1usize,
- concat!("Alignment of ", stringify!(WhitelistMe))
+ concat!("Alignment of ", stringify!(AllowlistMe))
);
assert_eq!(
unsafe {
- &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize
+ &(*(::std::ptr::null::<AllowlistMe>())).a as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
- stringify!(WhitelistMe),
+ stringify!(AllowlistMe),
"::",
stringify!(a)
)
diff --git a/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs b/tests/expectations/tests/allowlisted-item-references-no-partialeq.rs
index 2aabc101..f26f6923 100644
--- a/tests/expectations/tests/whitelisted-item-references-no-partialeq.rs
+++ b/tests/expectations/tests/allowlisted-item-references-no-partialeq.rs
@@ -25,29 +25,29 @@ fn bindgen_test_layout_NoPartialEq() {
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
-pub struct WhitelistMe {
+pub struct AllowlistMe {
pub a: NoPartialEq,
}
#[test]
-fn bindgen_test_layout_WhitelistMe() {
+fn bindgen_test_layout_AllowlistMe() {
assert_eq!(
- ::std::mem::size_of::<WhitelistMe>(),
+ ::std::mem::size_of::<AllowlistMe>(),
1usize,
- concat!("Size of: ", stringify!(WhitelistMe))
+ concat!("Size of: ", stringify!(AllowlistMe))
);
assert_eq!(
- ::std::mem::align_of::<WhitelistMe>(),
+ ::std::mem::align_of::<AllowlistMe>(),
1usize,
- concat!("Alignment of ", stringify!(WhitelistMe))
+ concat!("Alignment of ", stringify!(AllowlistMe))
);
assert_eq!(
unsafe {
- &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize
+ &(*(::std::ptr::null::<AllowlistMe>())).a as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
- stringify!(WhitelistMe),
+ stringify!(AllowlistMe),
"::",
stringify!(a)
)
diff --git a/tests/expectations/tests/whitelisted_item_references_no_copy.rs b/tests/expectations/tests/allowlisted_item_references_no_copy.rs
index d13ede59..a5cb17b2 100644
--- a/tests/expectations/tests/whitelisted_item_references_no_copy.rs
+++ b/tests/expectations/tests/allowlisted_item_references_no_copy.rs
@@ -25,29 +25,29 @@ fn bindgen_test_layout_NoCopy() {
}
#[repr(C)]
#[derive(Debug, Default)]
-pub struct WhitelistMe {
+pub struct AllowlistMe {
pub a: NoCopy,
}
#[test]
-fn bindgen_test_layout_WhitelistMe() {
+fn bindgen_test_layout_AllowlistMe() {
assert_eq!(
- ::std::mem::size_of::<WhitelistMe>(),
+ ::std::mem::size_of::<AllowlistMe>(),
1usize,
- concat!("Size of: ", stringify!(WhitelistMe))
+ concat!("Size of: ", stringify!(AllowlistMe))
);
assert_eq!(
- ::std::mem::align_of::<WhitelistMe>(),
+ ::std::mem::align_of::<AllowlistMe>(),
1usize,
- concat!("Alignment of ", stringify!(WhitelistMe))
+ concat!("Alignment of ", stringify!(AllowlistMe))
);
assert_eq!(
unsafe {
- &(*(::std::ptr::null::<WhitelistMe>())).a as *const _ as usize
+ &(*(::std::ptr::null::<AllowlistMe>())).a as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
- stringify!(WhitelistMe),
+ stringify!(AllowlistMe),
"::",
stringify!(a)
)
diff --git a/tests/expectations/tests/anon_enum_whitelist.rs b/tests/expectations/tests/anon_enum_allowlist.rs
index f0c06c56..f0c06c56 100644
--- a/tests/expectations/tests/anon_enum_whitelist.rs
+++ b/tests/expectations/tests/anon_enum_allowlist.rs
diff --git a/tests/expectations/tests/blacklist-and-impl-debug.rs b/tests/expectations/tests/blocklist-and-impl-debug.rs
index 2609b2e8..f272f9be 100644
--- a/tests/expectations/tests/blacklist-and-impl-debug.rs
+++ b/tests/expectations/tests/blocklist-and-impl-debug.rs
@@ -5,12 +5,12 @@
non_upper_case_globals
)]
-pub struct BlacklistMe(u8);
+pub struct BlocklistMe(u8);
-/// Because this type contains a blacklisted type, it should not derive Debug.
+/// Because this type contains a blocklisted type, it should not derive Debug.
#[repr(C)]
pub struct ShouldManuallyImplDebug {
- pub a: BlacklistMe,
+ pub a: BlocklistMe,
}
#[test]
fn bindgen_test_layout_ShouldManuallyImplDebug() {
diff --git a/tests/expectations/tests/blacklist-function.rs b/tests/expectations/tests/blocklist-function.rs
index 5299b151..5299b151 100644
--- a/tests/expectations/tests/blacklist-function.rs
+++ b/tests/expectations/tests/blocklist-function.rs
diff --git a/tests/expectations/tests/blacklist-item.rs b/tests/expectations/tests/blocklist-item.rs
index 0edee9ec..0edee9ec 100644
--- a/tests/expectations/tests/blacklist-item.rs
+++ b/tests/expectations/tests/blocklist-item.rs
diff --git a/tests/expectations/tests/derive-default-and-blacklist.rs b/tests/expectations/tests/derive-default-and-blocklist.rs
index ce0f2528..fca9c7f3 100644
--- a/tests/expectations/tests/derive-default-and-blacklist.rs
+++ b/tests/expectations/tests/derive-default-and-blocklist.rs
@@ -5,13 +5,13 @@
non_upper_case_globals
)]
-pub struct BlacklistMe(u8);
+pub struct BlocklistMe(u8);
-/// Because this type contains a blacklisted type, it should not derive
+/// Because this type contains a blocklisted type, it should not derive
/// Default. Instead, we should emit a `mem::zeroed` implementation.
#[repr(C)]
pub struct ShouldNotDeriveDefault {
- pub a: BlacklistMe,
+ pub a: BlocklistMe,
}
#[test]
fn bindgen_test_layout_ShouldNotDeriveDefault() {
diff --git a/tests/expectations/tests/derive-hash-and-blacklist.rs b/tests/expectations/tests/derive-hash-and-blocklist.rs
index 458081a4..ba606a25 100644
--- a/tests/expectations/tests/derive-hash-and-blacklist.rs
+++ b/tests/expectations/tests/derive-hash-and-blocklist.rs
@@ -5,12 +5,12 @@
non_upper_case_globals
)]
-pub struct BlacklistMe(u8);
+pub struct BlocklistMe(u8);
-/// Because this type contains a blacklisted type, it should not derive Hash.
+/// Because this type contains a blocklisted type, it should not derive Hash.
#[repr(C)]
pub struct ShouldNotDeriveHash {
- pub a: BlacklistMe,
+ pub a: BlocklistMe,
}
#[test]
fn bindgen_test_layout_ShouldNotDeriveHash() {
diff --git a/tests/expectations/tests/derive-hash-blacklisting.rs b/tests/expectations/tests/derive-hash-blocklisting.rs
index 0424077b..f9dbc824 100644
--- a/tests/expectations/tests/derive-hash-blacklisting.rs
+++ b/tests/expectations/tests/derive-hash-blocklisting.rs
@@ -7,78 +7,78 @@
#[repr(C)]
#[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)]
-pub struct Blacklisted<T> {
+pub struct Blocklisted<T> {
t: T,
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
}
-/// This would derive(Hash, Eq, PartialEq) if it didn't contain a blacklisted type,
+/// This would derive(Hash, Eq, PartialEq) if it didn't contain a blocklisted type,
/// causing us to conservatively avoid deriving hash/Eq/PartialEq for it.
#[repr(C)]
-pub struct WhitelistedOne {
- pub a: Blacklisted<::std::os::raw::c_int>,
+pub struct AllowlistedOne {
+ pub a: Blocklisted<::std::os::raw::c_int>,
}
#[test]
-fn bindgen_test_layout_WhitelistedOne() {
+fn bindgen_test_layout_AllowlistedOne() {
assert_eq!(
- ::std::mem::size_of::<WhitelistedOne>(),
+ ::std::mem::size_of::<AllowlistedOne>(),
4usize,
- concat!("Size of: ", stringify!(WhitelistedOne))
+ concat!("Size of: ", stringify!(AllowlistedOne))
);
assert_eq!(
- ::std::mem::align_of::<WhitelistedOne>(),
+ ::std::mem::align_of::<AllowlistedOne>(),
4usize,
- concat!("Alignment of ", stringify!(WhitelistedOne))
+ concat!("Alignment of ", stringify!(AllowlistedOne))
);
assert_eq!(
unsafe {
- &(*(::std::ptr::null::<WhitelistedOne>())).a as *const _ as usize
+ &(*(::std::ptr::null::<AllowlistedOne>())).a as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
- stringify!(WhitelistedOne),
+ stringify!(AllowlistedOne),
"::",
stringify!(a)
)
);
}
-impl Default for WhitelistedOne {
+impl Default for AllowlistedOne {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
-/// This can't derive(Hash/Eq) even if it didn't contain a blacklisted type.
+/// This can't derive(Hash/Eq) even if it didn't contain a blocklisted type.
#[repr(C)]
-pub struct WhitelistedTwo {
- pub b: Blacklisted<f32>,
+pub struct AllowlistedTwo {
+ pub b: Blocklisted<f32>,
}
#[test]
-fn bindgen_test_layout_WhitelistedTwo() {
+fn bindgen_test_layout_AllowlistedTwo() {
assert_eq!(
- ::std::mem::size_of::<WhitelistedTwo>(),
+ ::std::mem::size_of::<AllowlistedTwo>(),
4usize,
- concat!("Size of: ", stringify!(WhitelistedTwo))
+ concat!("Size of: ", stringify!(AllowlistedTwo))
);
assert_eq!(
- ::std::mem::align_of::<WhitelistedTwo>(),
+ ::std::mem::align_of::<AllowlistedTwo>(),
4usize,
- concat!("Alignment of ", stringify!(WhitelistedTwo))
+ concat!("Alignment of ", stringify!(AllowlistedTwo))
);
assert_eq!(
unsafe {
- &(*(::std::ptr::null::<WhitelistedTwo>())).b as *const _ as usize
+ &(*(::std::ptr::null::<AllowlistedTwo>())).b as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
- stringify!(WhitelistedTwo),
+ stringify!(AllowlistedTwo),
"::",
stringify!(b)
)
);
}
-impl Default for WhitelistedTwo {
+impl Default for AllowlistedTwo {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
diff --git a/tests/expectations/tests/derive-partialeq-and-blacklist.rs b/tests/expectations/tests/derive-partialeq-and-blocklist.rs
index 88bccdff..b211933d 100644
--- a/tests/expectations/tests/derive-partialeq-and-blacklist.rs
+++ b/tests/expectations/tests/derive-partialeq-and-blocklist.rs
@@ -5,13 +5,13 @@
non_upper_case_globals
)]
-pub struct BlacklistMe(u8);
+pub struct BlocklistMe(u8);
-/// Because this type contains a blacklisted type, it should not derive
+/// Because this type contains a blocklisted type, it should not derive
/// PartialEq.
#[repr(C)]
pub struct ShouldNotDerivePartialEq {
- pub a: BlacklistMe,
+ pub a: BlocklistMe,
}
#[test]
fn bindgen_test_layout_ShouldNotDerivePartialEq() {
diff --git a/tests/expectations/tests/dynamic_loading_with_whitelist.rs b/tests/expectations/tests/dynamic_loading_with_allowlist.rs
index 0c1d9df2..0c1d9df2 100644
--- a/tests/expectations/tests/dynamic_loading_with_whitelist.rs
+++ b/tests/expectations/tests/dynamic_loading_with_allowlist.rs
diff --git a/tests/expectations/tests/dynamic_loading_with_blacklist.rs b/tests/expectations/tests/dynamic_loading_with_blocklist.rs
index 15092f06..15092f06 100644
--- a/tests/expectations/tests/dynamic_loading_with_blacklist.rs
+++ b/tests/expectations/tests/dynamic_loading_with_blocklist.rs
diff --git a/tests/expectations/tests/inline_namespace_whitelist.rs b/tests/expectations/tests/inline_namespace_allowlist.rs
index 1f4bc686..1f4bc686 100644
--- a/tests/expectations/tests/inline_namespace_whitelist.rs
+++ b/tests/expectations/tests/inline_namespace_allowlist.rs
diff --git a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs
index bad51ff4..7fd9caa3 100644
--- a/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs
+++ b/tests/expectations/tests/issue-807-opaque-types-methods-being-generated.rs
@@ -104,30 +104,30 @@ extern "C" {
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
-pub struct Whitelisted {
+pub struct Allowlisted {
pub some_member: Opaque,
}
#[test]
-fn bindgen_test_layout_Whitelisted() {
+fn bindgen_test_layout_Allowlisted() {
assert_eq!(
- ::std::mem::size_of::<Whitelisted>(),
+ ::std::mem::size_of::<Allowlisted>(),
1usize,
- concat!("Size of: ", stringify!(Whitelisted))
+ concat!("Size of: ", stringify!(Allowlisted))
);
assert_eq!(
- ::std::mem::align_of::<Whitelisted>(),
+ ::std::mem::align_of::<Allowlisted>(),
1usize,
- concat!("Alignment of ", stringify!(Whitelisted))
+ concat!("Alignment of ", stringify!(Allowlisted))
);
assert_eq!(
unsafe {
- &(*(::std::ptr::null::<Whitelisted>())).some_member as *const _
+ &(*(::std::ptr::null::<Allowlisted>())).some_member as *const _
as usize
},
0usize,
concat!(
"Offset of field: ",
- stringify!(Whitelisted),
+ stringify!(Allowlisted),
"::",
stringify!(some_member)
)
diff --git a/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs b/tests/expectations/tests/issue-944-derive-copy-and-blocklisting.rs
index bcb5550f..51e97964 100644
--- a/tests/expectations/tests/issue-944-derive-copy-and-blacklisting.rs
+++ b/tests/expectations/tests/issue-944-derive-copy-and-blocklisting.rs
@@ -5,12 +5,12 @@
non_upper_case_globals
)]
-pub struct BlacklistMe(u8);
+pub struct BlocklistMe(u8);
-/// Because this type contains a blacklisted type, it should not derive Copy.
+/// Because this type contains a blocklisted type, it should not derive Copy.
#[repr(C)]
pub struct ShouldNotBeCopy {
- pub a: BlacklistMe,
+ pub a: BlocklistMe,
}
#[test]
fn bindgen_test_layout_ShouldNotBeCopy() {
diff --git a/tests/expectations/tests/module-whitelisted.rs b/tests/expectations/tests/module-allowlisted.rs
index 30cdb358..30cdb358 100644
--- a/tests/expectations/tests/module-whitelisted.rs
+++ b/tests/expectations/tests/module-allowlisted.rs
diff --git a/tests/expectations/tests/no-derive-debug.rs b/tests/expectations/tests/no-derive-debug.rs
index 0ddc5e23..d58093ec 100644
--- a/tests/expectations/tests/no-derive-debug.rs
+++ b/tests/expectations/tests/no-derive-debug.rs
@@ -11,7 +11,7 @@ pub struct foo {
bar: ::std::os::raw::c_int,
}
-/// bar should compile. It will normally derive debug, but our blacklist of foo
+/// bar should compile. It will normally derive debug, but our blocklist of foo
/// and replacement for another type that doesn't implement it would prevent it
/// from building if --no-derive-debug didn't work.
#[repr(C)]
diff --git a/tests/expectations/tests/no-derive-default.rs b/tests/expectations/tests/no-derive-default.rs
index 995b1320..eda13aad 100644
--- a/tests/expectations/tests/no-derive-default.rs
+++ b/tests/expectations/tests/no-derive-default.rs
@@ -11,7 +11,7 @@ pub struct foo {
bar: ::std::os::raw::c_int,
}
-/// bar should compile. It will normally derive default, but our blacklist of foo
+/// bar should compile. It will normally derive default, but our blocklist of foo
/// and replacement for another type that doesn't implement it would prevent it
/// from building if --no-derive-default didn't work.
#[repr(C)]
diff --git a/tests/expectations/tests/no-hash-whitelisted.rs b/tests/expectations/tests/no-hash-allowlisted.rs
index 1cd7f672..1cd7f672 100644
--- a/tests/expectations/tests/no-hash-whitelisted.rs
+++ b/tests/expectations/tests/no-hash-allowlisted.rs
diff --git a/tests/expectations/tests/no-partialeq-whitelisted.rs b/tests/expectations/tests/no-partialeq-allowlisted.rs
index cd3ed3b9..cd3ed3b9 100644
--- a/tests/expectations/tests/no-partialeq-whitelisted.rs
+++ b/tests/expectations/tests/no-partialeq-allowlisted.rs
diff --git a/tests/expectations/tests/no-recursive-whitelisting.rs b/tests/expectations/tests/no-recursive-allowlisting.rs
index 047b22ef..047b22ef 100644
--- a/tests/expectations/tests/no-recursive-whitelisting.rs
+++ b/tests/expectations/tests/no-recursive-allowlisting.rs
diff --git a/tests/expectations/tests/no_copy_whitelisted.rs b/tests/expectations/tests/no_copy_allowlisted.rs
index fa53bb66..fa53bb66 100644
--- a/tests/expectations/tests/no_copy_whitelisted.rs
+++ b/tests/expectations/tests/no_copy_allowlisted.rs
diff --git a/tests/expectations/tests/no_debug_whitelisted.rs b/tests/expectations/tests/no_debug_allowlisted.rs
index e240d645..e240d645 100644
--- a/tests/expectations/tests/no_debug_whitelisted.rs
+++ b/tests/expectations/tests/no_debug_allowlisted.rs
diff --git a/tests/expectations/tests/no_default_whitelisted.rs b/tests/expectations/tests/no_default_allowlisted.rs
index 980f1575..980f1575 100644
--- a/tests/expectations/tests/no_default_whitelisted.rs
+++ b/tests/expectations/tests/no_default_allowlisted.rs
diff --git a/tests/expectations/tests/objc_whitelist.rs b/tests/expectations/tests/objc_allowlist.rs
index 213f1024..dcec0fd1 100644
--- a/tests/expectations/tests/objc_whitelist.rs
+++ b/tests/expectations/tests/objc_allowlist.rs
@@ -10,5 +10,5 @@
extern crate objc;
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
-impl WhitelistMe_InterestingCategory for WhitelistMe {}
-pub trait WhitelistMe_InterestingCategory: Sized + std::ops::Deref {}
+impl AllowlistMe_InterestingCategory for AllowlistMe {}
+pub trait AllowlistMe_InterestingCategory: Sized + std::ops::Deref {}
diff --git a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs b/tests/expectations/tests/type-referenced-by-allowlisted-function.rs
index 568f9433..568f9433 100644
--- a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs
+++ b/tests/expectations/tests/type-referenced-by-allowlisted-function.rs
diff --git a/tests/headers/whitelist-namespaces-basic.hpp b/tests/headers/allowlist-namespaces-basic.hpp
index 2eaa8740..fb4dd1be 100644
--- a/tests/headers/whitelist-namespaces-basic.hpp
+++ b/tests/headers/allowlist-namespaces-basic.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type outer::inner::Helper
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type outer::inner::Helper
namespace outer {
namespace inner {
diff --git a/tests/headers/whitelist-namespaces.hpp b/tests/headers/allowlist-namespaces.hpp
index d34cbe94..2cffe9d3 100644
--- a/tests/headers/whitelist-namespaces.hpp
+++ b/tests/headers/allowlist-namespaces.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type '.*'
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type '.*'
namespace outer {
namespace inner {
diff --git a/tests/headers/whitelist_basic.hpp b/tests/headers/allowlist_basic.hpp
index 8424f75a..ef858c95 100644
--- a/tests/headers/whitelist_basic.hpp
+++ b/tests/headers/allowlist_basic.hpp
@@ -1,7 +1,7 @@
-// bindgen-flags: --whitelist-type WhitelistMe
+// bindgen-flags: --allowlist-type AllowlistMe
template<typename T>
-class WhitelistMe {
+class AllowlistMe {
class Inner {
T bar;
};
@@ -10,7 +10,7 @@ class WhitelistMe {
Inner bar;
};
-struct DontWhitelistMe {
+struct DontAllowlistMe {
void* foo;
double _Complex noComplexGenerated;
};
diff --git a/tests/headers/whitelist_fix.hpp b/tests/headers/allowlist_fix.hpp
index d0abda54..ff810fc6 100644
--- a/tests/headers/whitelist_fix.hpp
+++ b/tests/headers/allowlist_fix.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --whitelist-function 'Servo_.*' --blacklist-type Test --raw-line "pub enum Test {}"
+// bindgen-flags: --allowlist-function 'Servo_.*' --blocklist-type Test --raw-line "pub enum Test {}"
struct Test {};
extern "C" void Servo_Test(Test* a);
diff --git a/tests/headers/whitelist_vars.h b/tests/headers/allowlist_vars.h
index 07fa2815..07fa2815 100644
--- a/tests/headers/whitelist_vars.h
+++ b/tests/headers/allowlist_vars.h
diff --git a/tests/headers/allowlisted-item-references-no-hash.hpp b/tests/headers/allowlisted-item-references-no-hash.hpp
new file mode 100644
index 00000000..56c2a39f
--- /dev/null
+++ b/tests/headers/allowlisted-item-references-no-hash.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: --with-derive-hash --allowlist-type "AllowlistMe" --no-hash "NoHash"
+
+struct NoHash {};
+
+class AllowlistMe {
+ NoHash a;
+};
diff --git a/tests/headers/allowlisted-item-references-no-partialeq.hpp b/tests/headers/allowlisted-item-references-no-partialeq.hpp
new file mode 100644
index 00000000..d85fb6b7
--- /dev/null
+++ b/tests/headers/allowlisted-item-references-no-partialeq.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: --with-derive-partialeq --allowlist-type "AllowlistMe" --no-partialeq "NoPartialEq"
+
+struct NoPartialEq {};
+
+class AllowlistMe {
+ NoPartialEq a;
+};
diff --git a/tests/headers/allowlisted_item_references_no_copy.hpp b/tests/headers/allowlisted_item_references_no_copy.hpp
new file mode 100644
index 00000000..9feb3054
--- /dev/null
+++ b/tests/headers/allowlisted_item_references_no_copy.hpp
@@ -0,0 +1,7 @@
+// bindgen-flags: --allowlist-type "AllowlistMe" --no-copy "NoCopy"
+
+struct NoCopy {};
+
+class AllowlistMe {
+ NoCopy a;
+};
diff --git a/tests/headers/anon_enum_allowlist.h b/tests/headers/anon_enum_allowlist.h
new file mode 100644
index 00000000..94119a87
--- /dev/null
+++ b/tests/headers/anon_enum_allowlist.h
@@ -0,0 +1,6 @@
+// bindgen-flags: --allowlist-var "NODE_.*" --rustified-enum ".*"
+
+enum {
+ NODE_FLAG_FOO,
+ NODE_FLAG_BAR,
+};
diff --git a/tests/headers/anon_enum_whitelist.h b/tests/headers/anon_enum_whitelist.h
deleted file mode 100644
index a35e4886..00000000
--- a/tests/headers/anon_enum_whitelist.h
+++ /dev/null
@@ -1,6 +0,0 @@
-// bindgen-flags: --whitelist-var "NODE_.*" --rustified-enum ".*"
-
-enum {
- NODE_FLAG_FOO,
- NODE_FLAG_BAR,
-};
diff --git a/tests/headers/blacklist-and-impl-debug.hpp b/tests/headers/blacklist-and-impl-debug.hpp
deleted file mode 100644
index b4b39fe4..00000000
--- a/tests/headers/blacklist-and-impl-debug.hpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// bindgen-flags: --impl-debug --blacklist-type BlacklistMe --raw-line 'pub struct BlacklistMe(u8);'
-
-struct BlacklistMe {};
-
-/**
- * Because this type contains a blacklisted type, it should not derive Debug.
- */
-struct ShouldManuallyImplDebug {
- BlacklistMe a;
-};
diff --git a/tests/headers/blocklist-and-impl-debug.hpp b/tests/headers/blocklist-and-impl-debug.hpp
new file mode 100644
index 00000000..14e17537
--- /dev/null
+++ b/tests/headers/blocklist-and-impl-debug.hpp
@@ -0,0 +1,10 @@
+// bindgen-flags: --impl-debug --blocklist-type BlocklistMe --raw-line 'pub struct BlocklistMe(u8);'
+
+struct BlocklistMe {};
+
+/**
+ * Because this type contains a blocklisted type, it should not derive Debug.
+ */
+struct ShouldManuallyImplDebug {
+ BlocklistMe a;
+};
diff --git a/tests/headers/blacklist-function.hpp b/tests/headers/blocklist-function.hpp
index 8087295c..d7c8bb35 100644
--- a/tests/headers/blacklist-function.hpp
+++ b/tests/headers/blocklist-function.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --blacklist-function "ExternFunction" --blacklist-function "foo::NamespacedFunction" --blacklist-function "C_ClassMethod" --enable-cxx-namespaces
+// bindgen-flags: --blocklist-function "ExternFunction" --blocklist-function "foo::NamespacedFunction" --blocklist-function "C_ClassMethod" --enable-cxx-namespaces
extern "C" void ExternFunction();
diff --git a/tests/headers/blacklist-item.hpp b/tests/headers/blocklist-item.hpp
index 8d569dde..2d795d5a 100644
--- a/tests/headers/blacklist-item.hpp
+++ b/tests/headers/blocklist-item.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --blacklist-item "SomeFunction" --blacklist-item "SOME_DEFUN" --blacklist-item "someVar" --blacklist-item "ExternFunction" --blacklist-item "foo::NamespacedFunction" --blacklist-item "someClass.*" --enable-cxx-namespaces
+// bindgen-flags: --blocklist-item "SomeFunction" --blocklist-item "SOME_DEFUN" --blocklist-item "someVar" --blocklist-item "ExternFunction" --blocklist-item "foo::NamespacedFunction" --blocklist-item "someClass.*" --enable-cxx-namespaces
void SomeFunction();
extern int someVar;
diff --git a/tests/headers/derive-default-and-blacklist.hpp b/tests/headers/derive-default-and-blocklist.hpp
index 7a2b7505..20d938cc 100644
--- a/tests/headers/derive-default-and-blacklist.hpp
+++ b/tests/headers/derive-default-and-blocklist.hpp
@@ -1,14 +1,14 @@
-// bindgen-flags: --blacklist-type BlacklistMe --raw-line 'pub struct BlacklistMe(u8);'
+// bindgen-flags: --blocklist-type BlocklistMe --raw-line 'pub struct BlocklistMe(u8);'
// Note that we do not explicitly provide the `--with-derive-default` flag
// above, since it is added by the test runner implicitly.
-struct BlacklistMe {};
+struct BlocklistMe {};
/**
- * Because this type contains a blacklisted type, it should not derive
+ * Because this type contains a blocklisted type, it should not derive
* Default. Instead, we should emit a `mem::zeroed` implementation.
*/
struct ShouldNotDeriveDefault {
- BlacklistMe a;
+ BlocklistMe a;
};
diff --git a/tests/headers/derive-hash-and-blacklist.hpp b/tests/headers/derive-hash-and-blacklist.hpp
deleted file mode 100644
index 4b3a4a53..00000000
--- a/tests/headers/derive-hash-and-blacklist.hpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// bindgen-flags: --with-derive-hash --blacklist-type BlacklistMe --raw-line 'pub struct BlacklistMe(u8);'
-
-struct BlacklistMe {};
-
-/**
- * Because this type contains a blacklisted type, it should not derive Hash.
- */
-struct ShouldNotDeriveHash {
- BlacklistMe a;
-};
diff --git a/tests/headers/derive-hash-and-blocklist.hpp b/tests/headers/derive-hash-and-blocklist.hpp
new file mode 100644
index 00000000..51a3372f
--- /dev/null
+++ b/tests/headers/derive-hash-and-blocklist.hpp
@@ -0,0 +1,10 @@
+// bindgen-flags: --with-derive-hash --blocklist-type BlocklistMe --raw-line 'pub struct BlocklistMe(u8);'
+
+struct BlocklistMe {};
+
+/**
+ * Because this type contains a blocklisted type, it should not derive Hash.
+ */
+struct ShouldNotDeriveHash {
+ BlocklistMe a;
+};
diff --git a/tests/headers/derive-hash-blacklisting.hpp b/tests/headers/derive-hash-blacklisting.hpp
deleted file mode 100644
index e3256a01..00000000
--- a/tests/headers/derive-hash-blacklisting.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// bindgen-flags: --with-derive-hash --with-derive-partialord --with-derive-ord --with-derive-partialeq --with-derive-eq --whitelist-type 'Whitelisted.*' --blacklist-type Blacklisted --raw-line "#[repr(C)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct Blacklisted<T> {t: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>> }"
-//
-template <class T>
-struct Blacklisted {
- T t;
-};
-
-/// This would derive(Hash, Eq, PartialEq) if it didn't contain a blacklisted type,
-/// causing us to conservatively avoid deriving hash/Eq/PartialEq for it.
-struct WhitelistedOne {
- Blacklisted<int> a;
-};
-
-/// This can't derive(Hash/Eq) even if it didn't contain a blacklisted type.
-struct WhitelistedTwo {
- Blacklisted<float> b;
-};
diff --git a/tests/headers/derive-hash-blocklisting.hpp b/tests/headers/derive-hash-blocklisting.hpp
new file mode 100644
index 00000000..4e20e392
--- /dev/null
+++ b/tests/headers/derive-hash-blocklisting.hpp
@@ -0,0 +1,17 @@
+// bindgen-flags: --with-derive-hash --with-derive-partialord --with-derive-ord --with-derive-partialeq --with-derive-eq --allowlist-type 'Allowlisted.*' --blocklist-type Blocklisted --raw-line "#[repr(C)] #[derive(Debug, Hash, Copy, Clone, PartialEq, Eq)] pub struct Blocklisted<T> {t: T, pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>> }"
+//
+template <class T>
+struct Blocklisted {
+ T t;
+};
+
+/// This would derive(Hash, Eq, PartialEq) if it didn't contain a blocklisted type,
+/// causing us to conservatively avoid deriving hash/Eq/PartialEq for it.
+struct AllowlistedOne {
+ Blocklisted<int> a;
+};
+
+/// This can't derive(Hash/Eq) even if it didn't contain a blocklisted type.
+struct AllowlistedTwo {
+ Blocklisted<float> b;
+};
diff --git a/tests/headers/derive-partialeq-and-blacklist.hpp b/tests/headers/derive-partialeq-and-blacklist.hpp
deleted file mode 100644
index a996eee8..00000000
--- a/tests/headers/derive-partialeq-and-blacklist.hpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// bindgen-flags: --with-derive-partialeq --blacklist-type BlacklistMe --raw-line 'pub struct BlacklistMe(u8);'
-
-struct BlacklistMe {};
-
-/**
- * Because this type contains a blacklisted type, it should not derive
- * PartialEq.
- */
-struct ShouldNotDerivePartialEq {
- BlacklistMe a;
-};
diff --git a/tests/headers/derive-partialeq-and-blocklist.hpp b/tests/headers/derive-partialeq-and-blocklist.hpp
new file mode 100644
index 00000000..953d0677
--- /dev/null
+++ b/tests/headers/derive-partialeq-and-blocklist.hpp
@@ -0,0 +1,11 @@
+// bindgen-flags: --with-derive-partialeq --blocklist-type BlocklistMe --raw-line 'pub struct BlocklistMe(u8);'
+
+struct BlocklistMe {};
+
+/**
+ * Because this type contains a blocklisted type, it should not derive
+ * PartialEq.
+ */
+struct ShouldNotDerivePartialEq {
+ BlocklistMe a;
+};
diff --git a/tests/headers/dynamic_loading_with_whitelist.hpp b/tests/headers/dynamic_loading_with_allowlist.hpp
index 33bfe805..995fbdd5 100644
--- a/tests/headers/dynamic_loading_with_whitelist.hpp
+++ b/tests/headers/dynamic_loading_with_allowlist.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --dynamic-loading TestLib --whitelist-function baz --whitelist-function foo --whitelist-function bazz
+// bindgen-flags: --dynamic-loading TestLib --allowlist-function baz --allowlist-function foo --allowlist-function bazz
class X {
int _x;
diff --git a/tests/headers/dynamic_loading_with_blacklist.hpp b/tests/headers/dynamic_loading_with_blocklist.hpp
index 2988ba69..81266d1f 100644
--- a/tests/headers/dynamic_loading_with_blacklist.hpp
+++ b/tests/headers/dynamic_loading_with_blocklist.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --dynamic-loading TestLib --blacklist-function baz
+// bindgen-flags: --dynamic-loading TestLib --blocklist-function baz
class X {
int _x;
diff --git a/tests/headers/inline_namespace_whitelist.hpp b/tests/headers/inline_namespace_allowlist.hpp
index 30047bbe..90e46dfb 100644
--- a/tests/headers/inline_namespace_whitelist.hpp
+++ b/tests/headers/inline_namespace_allowlist.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type=std::string -- -std=c++11
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type=std::string -- -std=c++11
namespace std {
inline namespace bar {
diff --git a/tests/headers/issue-1285.h b/tests/headers/issue-1285.h
index 7fb742ec..a2817d84 100644
--- a/tests/headers/issue-1285.h
+++ b/tests/headers/issue-1285.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-hash --no-recursive-whitelist --whitelist-type "foo"
+// bindgen-flags: --with-derive-hash --no-recursive-allowlist --allowlist-type "foo"
struct foo {
union {
diff --git a/tests/headers/issue-410.hpp b/tests/headers/issue-410.hpp
index b5d502f3..d4f3de3d 100644
--- a/tests/headers/issue-410.hpp
+++ b/tests/headers/issue-410.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type JS::Value --rustified-enum ".*"
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type JS::Value --rustified-enum ".*"
namespace JS {
class Value;
diff --git a/tests/headers/issue-447.hpp b/tests/headers/issue-447.hpp
index 017838c4..43765fa9 100644
--- a/tests/headers/issue-447.hpp
+++ b/tests/headers/issue-447.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type JSAutoCompartment -- -std=c++11
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type JSAutoCompartment -- -std=c++11
namespace mozilla {
template <typename> class a {};
diff --git a/tests/headers/issue-584-stylo-template-analysis-panic.hpp b/tests/headers/issue-584-stylo-template-analysis-panic.hpp
index 3bf00e5d..5f11ea3c 100644
--- a/tests/headers/issue-584-stylo-template-analysis-panic.hpp
+++ b/tests/headers/issue-584-stylo-template-analysis-panic.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --blacklist-type RefPtr --whitelist-function 'Servo_.*' --raw-line 'pub type RefPtr<T> = T;' -- -std=c++14
+// bindgen-flags: --blocklist-type RefPtr --allowlist-function 'Servo_.*' --raw-line 'pub type RefPtr<T> = T;' -- -std=c++14
template <class> class RefPtr;
class b;
class A {
diff --git a/tests/headers/issue-645-cannot-find-type-T-in-this-scope.hpp b/tests/headers/issue-645-cannot-find-type-T-in-this-scope.hpp
index f817f34d..8e07a8a0 100644
--- a/tests/headers/issue-645-cannot-find-type-T-in-this-scope.hpp
+++ b/tests/headers/issue-645-cannot-find-type-T-in-this-scope.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --blacklist-type RefPtr --raw-line "#[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T);" --whitelist-type "HasRefPtr" -- -std=c++14
+// bindgen-flags: --blocklist-type RefPtr --raw-line "#[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T);" --allowlist-type "HasRefPtr" -- -std=c++14
template <class> class RefPtr {};
diff --git a/tests/headers/issue-662-part-2.hpp b/tests/headers/issue-662-part-2.hpp
index 84edb397..1330c342 100644
--- a/tests/headers/issue-662-part-2.hpp
+++ b/tests/headers/issue-662-part-2.hpp
@@ -1,7 +1,7 @@
-// bindgen-flags: --blacklist-type RefPtr --raw-line '#[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T);' -- --std=c++14
+// bindgen-flags: --blocklist-type RefPtr --raw-line '#[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T);' -- --std=c++14
// This is pretty much the same as the other issue 662 test case, but this time
-// we blacklist RefPtr to exercise the instantiation-of-a-blacklisted-template
+// we blocklist RefPtr to exercise the instantiation-of-a-blocklisted-template
// path in the template analysis.
template <class> class RefPtr {};
diff --git a/tests/headers/issue-674-1.hpp b/tests/headers/issue-674-1.hpp
index aa3c6118..7fc781c1 100644
--- a/tests/headers/issue-674-1.hpp
+++ b/tests/headers/issue-674-1.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type CapturingContentInfo --opaque-type 'mozilla::Maybe' -- -std=c++14
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type CapturingContentInfo --opaque-type 'mozilla::Maybe' -- -std=c++14
namespace mozilla {
template <class T> class Maybe { using ValueType = T; };
diff --git a/tests/headers/issue-674-2.hpp b/tests/headers/issue-674-2.hpp
index 58abcae2..86d2b648 100644
--- a/tests/headers/issue-674-2.hpp
+++ b/tests/headers/issue-674-2.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type StaticRefPtr --opaque-type 'JS::Rooted' -- -std=c++14
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type StaticRefPtr --opaque-type 'JS::Rooted' -- -std=c++14
namespace JS {
template <typename T> class Rooted { using ElementType = T; };
diff --git a/tests/headers/issue-674-3.hpp b/tests/headers/issue-674-3.hpp
index 2794c192..20aa463c 100644
--- a/tests/headers/issue-674-3.hpp
+++ b/tests/headers/issue-674-3.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type nsCSSValue --opaque-type 'nsRefPtrHashtable' -- -std=c++14
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type nsCSSValue --opaque-type 'nsRefPtrHashtable' -- -std=c++14
template <class PtrType> class nsRefPtrHashtable {
typedef PtrType *UserDataType;
diff --git a/tests/headers/issue-769-bad-instantiation-test.hpp b/tests/headers/issue-769-bad-instantiation-test.hpp
index 1be89a66..13c6dd1c 100644
--- a/tests/headers/issue-769-bad-instantiation-test.hpp
+++ b/tests/headers/issue-769-bad-instantiation-test.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --enable-cxx-namespaces --whitelist-type Rooted
+// bindgen-flags: --enable-cxx-namespaces --allowlist-type Rooted
template <typename T>
class Rooted {
diff --git a/tests/headers/issue-801-opaque-sloppiness.hpp b/tests/headers/issue-801-opaque-sloppiness.hpp
index 67858634..6b707f4e 100644
--- a/tests/headers/issue-801-opaque-sloppiness.hpp
+++ b/tests/headers/issue-801-opaque-sloppiness.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --opaque-type "B" --whitelist-type "C" --with-derive-hash --with-derive-partialeq --with-derive-eq
+// bindgen-flags: --opaque-type "B" --allowlist-type "C" --with-derive-hash --with-derive-partialeq --with-derive-eq
class A;
diff --git a/tests/headers/issue-807-opaque-types-methods-being-generated.hpp b/tests/headers/issue-807-opaque-types-methods-being-generated.hpp
index 91f221ce..de98b32a 100644
--- a/tests/headers/issue-807-opaque-types-methods-being-generated.hpp
+++ b/tests/headers/issue-807-opaque-types-methods-being-generated.hpp
@@ -1,12 +1,12 @@
-// bindgen-flags: --whitelist-type Whitelisted --opaque-type Opaque --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++11
+// bindgen-flags: --allowlist-type Allowlisted --opaque-type Opaque --with-derive-hash --with-derive-partialeq --with-derive-eq -- -std=c++11
-// These types are not explicitly whitelisted, but are reachable through the
+// These types are not explicitly allowlisted, but are reachable through the
// opaque type.
class Pupper {};
class Doggo {};
class SuchWow {};
-// These types are not whitelisted, and would be reachable through `Opaque` if
+// These types are not allowlisted, and would be reachable through `Opaque` if
// it were not marked opaque, but since it is, there should be no bindings
// generated for them.
class NoBindingsShouldBeGeneratedForMe1 {};
@@ -31,6 +31,6 @@ protected:
SuchWow eleven_out_of_ten();
};
-class Whitelisted {
+class Allowlisted {
Opaque some_member;
};
diff --git a/tests/headers/issue-833-1.hpp b/tests/headers/issue-833-1.hpp
index 30bf85f2..d66ee01f 100644
--- a/tests/headers/issue-833-1.hpp
+++ b/tests/headers/issue-833-1.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --generate functions --whitelist-function func --raw-line "#[repr(C)] pub struct nsTArray { pub hdr: *const () }"
+// bindgen-flags: --generate functions --allowlist-function func --raw-line "#[repr(C)] pub struct nsTArray { pub hdr: *const () }"
template<typename T>
class nsTArray {
diff --git a/tests/headers/issue-833.hpp b/tests/headers/issue-833.hpp
index ea0d2add..f8b708bf 100644
--- a/tests/headers/issue-833.hpp
+++ b/tests/headers/issue-833.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --generate functions --whitelist-function func --raw-line "#[repr(C)] pub struct nsTArray<T> { pub hdr: *const T }"
+// bindgen-flags: --generate functions --allowlist-function func --raw-line "#[repr(C)] pub struct nsTArray<T> { pub hdr: *const T }"
template<typename T>
class nsTArray {
diff --git a/tests/headers/issue-834.hpp b/tests/headers/issue-834.hpp
index c06e89fd..64797012 100644
--- a/tests/headers/issue-834.hpp
+++ b/tests/headers/issue-834.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --whitelist-type U --generate types
+// bindgen-flags: --allowlist-type U --generate types
struct T {};
struct U {
diff --git a/tests/headers/issue-944-derive-copy-and-blacklisting.hpp b/tests/headers/issue-944-derive-copy-and-blacklisting.hpp
deleted file mode 100644
index 657e0d84..00000000
--- a/tests/headers/issue-944-derive-copy-and-blacklisting.hpp
+++ /dev/null
@@ -1,10 +0,0 @@
-// bindgen-flags: --blacklist-type BlacklistMe --raw-line 'pub struct BlacklistMe(u8);'
-
-struct BlacklistMe {};
-
-/**
- * Because this type contains a blacklisted type, it should not derive Copy.
- */
-struct ShouldNotBeCopy {
- BlacklistMe a;
-};
diff --git a/tests/headers/issue-944-derive-copy-and-blocklisting.hpp b/tests/headers/issue-944-derive-copy-and-blocklisting.hpp
new file mode 100644
index 00000000..5e94dfab
--- /dev/null
+++ b/tests/headers/issue-944-derive-copy-and-blocklisting.hpp
@@ -0,0 +1,10 @@
+// bindgen-flags: --blocklist-type BlocklistMe --raw-line 'pub struct BlocklistMe(u8);'
+
+struct BlocklistMe {};
+
+/**
+ * Because this type contains a blocklisted type, it should not derive Copy.
+ */
+struct ShouldNotBeCopy {
+ BlocklistMe a;
+};
diff --git a/tests/headers/maddness-is-avoidable.hpp b/tests/headers/maddness-is-avoidable.hpp
index 46d7495e..47a7ffbf 100644
--- a/tests/headers/maddness-is-avoidable.hpp
+++ b/tests/headers/maddness-is-avoidable.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --blacklist-type RefPtr_Proxy_member_function
+// bindgen-flags: --blocklist-type RefPtr_Proxy_member_function
template<typename T>
class RefPtr {
diff --git a/tests/headers/module-whitelisted.hpp b/tests/headers/module-allowlisted.hpp
index f41e874e..f41e874e 100644
--- a/tests/headers/module-whitelisted.hpp
+++ b/tests/headers/module-allowlisted.hpp
diff --git a/tests/headers/no-derive-debug.h b/tests/headers/no-derive-debug.h
index c780d2d8..d11ca0ad 100644
--- a/tests/headers/no-derive-debug.h
+++ b/tests/headers/no-derive-debug.h
@@ -1,11 +1,11 @@
-// bindgen-flags: --no-derive-debug --blacklist-type foo --raw-line "#[repr(C)] #[derive(Copy, Clone, Default)] pub struct foo { bar: ::std::os::raw::c_int, }"
+// bindgen-flags: --no-derive-debug --blocklist-type foo --raw-line "#[repr(C)] #[derive(Copy, Clone, Default)] pub struct foo { bar: ::std::os::raw::c_int, }"
struct foo {
int bar;
};
/**
- * bar should compile. It will normally derive debug, but our blacklist of foo
+ * bar should compile. It will normally derive debug, but our blocklist of foo
* and replacement for another type that doesn't implement it would prevent it
* from building if --no-derive-debug didn't work.
*/
diff --git a/tests/headers/no-derive-default.h b/tests/headers/no-derive-default.h
index 207b93b6..d184ee3a 100644
--- a/tests/headers/no-derive-default.h
+++ b/tests/headers/no-derive-default.h
@@ -1,11 +1,11 @@
-// bindgen-flags: --no-derive-default --blacklist-type foo --raw-line "#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct foo { bar: ::std::os::raw::c_int, }"
+// bindgen-flags: --no-derive-default --blocklist-type foo --raw-line "#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct foo { bar: ::std::os::raw::c_int, }"
struct foo {
int bar;
};
/**
- * bar should compile. It will normally derive default, but our blacklist of foo
+ * bar should compile. It will normally derive default, but our blocklist of foo
* and replacement for another type that doesn't implement it would prevent it
* from building if --no-derive-default didn't work.
*/
diff --git a/tests/headers/no-hash-allowlisted.hpp b/tests/headers/no-hash-allowlisted.hpp
new file mode 100644
index 00000000..0f60817d
--- /dev/null
+++ b/tests/headers/no-hash-allowlisted.hpp
@@ -0,0 +1,5 @@
+// bindgen-flags: --with-derive-hash --allowlist-type "NoHash" --no-hash "NoHash"
+
+class NoHash {
+ int i;
+};
diff --git a/tests/headers/no-hash-whitelisted.hpp b/tests/headers/no-hash-whitelisted.hpp
deleted file mode 100644
index 77c90864..00000000
--- a/tests/headers/no-hash-whitelisted.hpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// bindgen-flags: --with-derive-hash --whitelist-type "NoHash" --no-hash "NoHash"
-
-class NoHash {
- int i;
-};
diff --git a/tests/headers/no-partialeq-whitelisted.hpp b/tests/headers/no-partialeq-allowlisted.hpp
index dba4e91f..ced1b42a 100644
--- a/tests/headers/no-partialeq-whitelisted.hpp
+++ b/tests/headers/no-partialeq-allowlisted.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --with-derive-partialeq --whitelist-type "NoPartialEq" --no-partialeq "NoPartialEq"
+// bindgen-flags: --with-derive-partialeq --allowlist-type "NoPartialEq" --no-partialeq "NoPartialEq"
class NoPartialEq {
int i;
diff --git a/tests/headers/no-recursive-whitelisting.h b/tests/headers/no-recursive-allowlisting.h
index c94cc491..1c661711 100644
--- a/tests/headers/no-recursive-whitelisting.h
+++ b/tests/headers/no-recursive-allowlisting.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --no-recursive-whitelist --whitelist-type "Foo" --raw-line "pub enum Bar {}" --rustified-enum ".*"
+// bindgen-flags: --no-recursive-allowlist --allowlist-type "Foo" --raw-line "pub enum Bar {}" --rustified-enum ".*"
struct Bar;
diff --git a/tests/headers/no_copy_allowlisted.hpp b/tests/headers/no_copy_allowlisted.hpp
new file mode 100644
index 00000000..f3b922ca
--- /dev/null
+++ b/tests/headers/no_copy_allowlisted.hpp
@@ -0,0 +1,5 @@
+// bindgen-flags: --allowlist-type "NoCopy" --no-copy "NoCopy"
+
+class NoCopy {
+ int i;
+};
diff --git a/tests/headers/no_copy_whitelisted.hpp b/tests/headers/no_copy_whitelisted.hpp
deleted file mode 100644
index db44a8a7..00000000
--- a/tests/headers/no_copy_whitelisted.hpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// bindgen-flags: --whitelist-type "NoCopy" --no-copy "NoCopy"
-
-class NoCopy {
- int i;
-};
diff --git a/tests/headers/no_debug_allowlisted.hpp b/tests/headers/no_debug_allowlisted.hpp
new file mode 100644
index 00000000..3e3633e4
--- /dev/null
+++ b/tests/headers/no_debug_allowlisted.hpp
@@ -0,0 +1,5 @@
+// bindgen-flags: --allowlist-type "NoDebug" --no-debug "NoDebug"
+
+class NoDebug {
+ int i;
+};
diff --git a/tests/headers/no_debug_whitelisted.hpp b/tests/headers/no_debug_whitelisted.hpp
deleted file mode 100644
index 7a855e81..00000000
--- a/tests/headers/no_debug_whitelisted.hpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// bindgen-flags: --whitelist-type "NoDebug" --no-debug "NoDebug"
-
-class NoDebug {
- int i;
-};
diff --git a/tests/headers/no_default_allowlisted.hpp b/tests/headers/no_default_allowlisted.hpp
new file mode 100644
index 00000000..8a604081
--- /dev/null
+++ b/tests/headers/no_default_allowlisted.hpp
@@ -0,0 +1,5 @@
+// bindgen-flags: --allowlist-type "NoDefault" --no-default "NoDefault"
+
+class NoDefault {
+ int i;
+};
diff --git a/tests/headers/no_default_whitelisted.hpp b/tests/headers/no_default_whitelisted.hpp
deleted file mode 100644
index 12676be6..00000000
--- a/tests/headers/no_default_whitelisted.hpp
+++ /dev/null
@@ -1,5 +0,0 @@
-// bindgen-flags: --whitelist-type "NoDefault" --no-default "NoDefault"
-
-class NoDefault {
- int i;
-};
diff --git a/tests/headers/objc_allowlist.h b/tests/headers/objc_allowlist.h
new file mode 100644
index 00000000..8c939960
--- /dev/null
+++ b/tests/headers/objc_allowlist.h
@@ -0,0 +1,24 @@
+// bindgen-flags: --objc-extern-crate --allowlist-type AllowlistMe --allowlist-type AllowlistMe_InterestingCategory -- -x objective-c
+// bindgen-osx-only
+
+
+// Protocol should be included, since it is used by the AllowlistMe
+@protocol SomeProtocol
+-(void)protocolMethod;
++(void)protocolClassMethod;
+@end
+
+// The allowlisted item
+@interface AllowlistMe <SomeProtocol>
+-(void)method;
++(void)classMethod;
+@end
+
+// This was also explicitly allowlisted
+@interface AllowlistMe (InterestingCategory)
+@end
+
+// This was not automatically allowlisted
+@interface AllowlistMe (IgnoredCategory)
+@end
+
diff --git a/tests/headers/objc_whitelist.h b/tests/headers/objc_whitelist.h
deleted file mode 100644
index 8a3bb869..00000000
--- a/tests/headers/objc_whitelist.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// bindgen-flags: --objc-extern-crate --whitelist-type WhitelistMe --whitelist-type WhitelistMe_InterestingCategory -- -x objective-c
-// bindgen-osx-only
-
-
-// Protocol should be included, since it is used by the WhitelistMe
-@protocol SomeProtocol
--(void)protocolMethod;
-+(void)protocolClassMethod;
-@end
-
-// The whitelisted item
-@interface WhitelistMe <SomeProtocol>
--(void)method;
-+(void)classMethod;
-@end
-
-// This was also explicitly whitelisted
-@interface WhitelistMe (InterestingCategory)
-@end
-
-// This was not automatically whitelisted
-@interface WhitelistMe (IgnoredCategory)
-@end
-
diff --git a/tests/headers/opaque-tracing.hpp b/tests/headers/opaque-tracing.hpp
index 9f7319cc..cf65276a 100644
--- a/tests/headers/opaque-tracing.hpp
+++ b/tests/headers/opaque-tracing.hpp
@@ -1,8 +1,8 @@
-// bindgen-flags: --opaque-type ".*" --whitelist-function=foo --with-derive-hash --with-derive-partialeq --with-derive-eq
+// bindgen-flags: --opaque-type ".*" --allowlist-function=foo --with-derive-hash --with-derive-partialeq --with-derive-eq
class Container;
-// The whitelist tracing should reach the Container type, even though it's
+// The allowlist tracing should reach the Container type, even though it's
// marked as opaque.
void foo(Container* c);
diff --git a/tests/headers/replaces_double.hpp b/tests/headers/replaces_double.hpp
index 1a78b0d9..ce6a8dbb 100644
--- a/tests/headers/replaces_double.hpp
+++ b/tests/headers/replaces_double.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --blacklist-type Wrapper -- --std=c++11
+// bindgen-flags: --blocklist-type Wrapper -- --std=c++11
template<typename T>
struct Wrapper {
diff --git a/tests/headers/type-referenced-by-whitelisted-function.h b/tests/headers/type-referenced-by-allowlisted-function.h
index 86b00303..bf675bc9 100644
--- a/tests/headers/type-referenced-by-whitelisted-function.h
+++ b/tests/headers/type-referenced-by-allowlisted-function.h
@@ -1,4 +1,4 @@
-// bindgen-flags: --whitelist-function dl_iterate_phdr
+// bindgen-flags: --allowlist-function dl_iterate_phdr
struct dl_phdr_info {
int x;
diff --git a/tests/headers/type_alias_empty.hpp b/tests/headers/type_alias_empty.hpp
index f0760c8f..bcccc3c8 100644
--- a/tests/headers/type_alias_empty.hpp
+++ b/tests/headers/type_alias_empty.hpp
@@ -1,6 +1,6 @@
-// bindgen-flags: --whitelist-type bool_constant -- -std=c++11
+// bindgen-flags: --allowlist-type bool_constant -- -std=c++11
-// NB: The --whitelist-type is done to trigger the traversal of the types on
+// NB: The --allowlist-type is done to trigger the traversal of the types on
// codegen in order to trigger #67.
template<typename T, T Val>
diff --git a/tests/headers/type_alias_template_specialized.hpp b/tests/headers/type_alias_template_specialized.hpp
index a2d32b56..f7403a36 100644
--- a/tests/headers/type_alias_template_specialized.hpp
+++ b/tests/headers/type_alias_template_specialized.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --whitelist-type Rooted -- -std=c++14
+// bindgen-flags: --allowlist-type Rooted -- -std=c++14
template <typename a> using MaybeWrapped = a;
class Rooted {
diff --git a/tests/headers/var-tracing.hpp b/tests/headers/var-tracing.hpp
index 0d0b0cca..ef002a00 100644
--- a/tests/headers/var-tracing.hpp
+++ b/tests/headers/var-tracing.hpp
@@ -1,4 +1,4 @@
-// bindgen-flags: --whitelist-type Baz
+// bindgen-flags: --allowlist-type Baz
struct Bar {
const int m_baz;
diff --git a/tests/headers/whitelisted-item-references-no-hash.hpp b/tests/headers/whitelisted-item-references-no-hash.hpp
deleted file mode 100644
index e656d32d..00000000
--- a/tests/headers/whitelisted-item-references-no-hash.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// bindgen-flags: --with-derive-hash --whitelist-type "WhitelistMe" --no-hash "NoHash"
-
-struct NoHash {};
-
-class WhitelistMe {
- NoHash a;
-};
diff --git a/tests/headers/whitelisted-item-references-no-partialeq.hpp b/tests/headers/whitelisted-item-references-no-partialeq.hpp
deleted file mode 100644
index d9d3d431..00000000
--- a/tests/headers/whitelisted-item-references-no-partialeq.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// bindgen-flags: --with-derive-partialeq --whitelist-type "WhitelistMe" --no-partialeq "NoPartialEq"
-
-struct NoPartialEq {};
-
-class WhitelistMe {
- NoPartialEq a;
-};
diff --git a/tests/headers/whitelisted_item_references_no_copy.hpp b/tests/headers/whitelisted_item_references_no_copy.hpp
deleted file mode 100644
index 755bbbdd..00000000
--- a/tests/headers/whitelisted_item_references_no_copy.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-// bindgen-flags: --whitelist-type "WhitelistMe" --no-copy "NoCopy"
-
-struct NoCopy {};
-
-class WhitelistMe {
- NoCopy a;
-};
diff --git a/tests/stylo.hpp b/tests/stylo.hpp
index d6eabc35..88102903 100644
--- a/tests/stylo.hpp
+++ b/tests/stylo.hpp
@@ -103701,7 +103701,7 @@ class nsIExpandedPrincipal : public nsISupports {
template<typename T, typename U> struct COMTypeInfo;
- virtual nsresult GetWhiteList(nsTArray<nsCOMPtr<nsIPrincipal> > **aWhiteList) = 0;
+ virtual nsresult GetAllowList(nsTArray<nsCOMPtr<nsIPrincipal> > **anAllowList) = 0;
};
diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs
index 88d87adb..2ea77628 100755
--- a/tests/stylo_sanity.rs
+++ b/tests/stylo_sanity.rs
@@ -30,209 +30,209 @@ fn sanity_check_can_generate_stylo_bindings() {
.time_phases(true)
.disable_header_comment()
.header(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/stylo.hpp"))
- .whitelist_function("Servo_.*")
- .whitelist_function("Gecko_.*")
- .blacklist_type("nsACString_internal")
- .blacklist_type("nsAString_internal")
- .blacklist_type("mozilla::css::URLValue")
- .blacklist_type("RawGeckoAnimationPropertySegment")
- .blacklist_type("RawGeckoComputedTiming")
- .blacklist_type("RawGeckoDocument")
- .blacklist_type("RawGeckoElement")
- .blacklist_type("RawGeckoKeyframeList")
- .blacklist_type("RawGeckoComputedKeyframeValuesList")
- .blacklist_type("RawGeckoFontFaceRuleList")
- .blacklist_type("RawGeckoNode")
- .blacklist_type("RawGeckoAnimationValueList")
- .blacklist_type("RawServoAnimationValue")
- .blacklist_type("RawServoAnimationValueMap")
- .blacklist_type("RawServoDeclarationBlock")
- .blacklist_type("RawGeckoPresContext")
- .blacklist_type("RawGeckoPresContextOwned")
- .blacklist_type("RawGeckoStyleAnimationList")
- .blacklist_type("RawGeckoURLExtraData")
- .blacklist_type("RefPtr")
- .blacklist_type("CSSPseudoClassType")
- .blacklist_type("TraversalRootBehavior")
- .blacklist_type("ComputedTimingFunction_BeforeFlag")
- .blacklist_type("FontFamilyList")
- .blacklist_type("FontFamilyType")
- .blacklist_type("Keyframe")
- .blacklist_type("ServoBundledURI")
- .blacklist_type("ServoElementSnapshot")
- .blacklist_type("SheetParsingMode")
- .blacklist_type("StyleBasicShape")
- .blacklist_type("StyleBasicShapeType")
- .blacklist_type("StyleShapeSource")
- .blacklist_type("nsCSSFontFaceRule")
- .blacklist_type("nsCSSKeyword")
- .blacklist_type("nsCSSPropertyID")
- .blacklist_type("nsCSSShadowArray")
- .blacklist_type("nsCSSUnit")
- .blacklist_type("nsCSSValue")
- .blacklist_type("nsCSSValueSharedList")
- .blacklist_type("nsChangeHint")
- .blacklist_type("nsCursorImage")
- .blacklist_type("nsFont")
- .blacklist_type("nsIAtom")
- .blacklist_type("nsMediaFeature")
- .blacklist_type("nsRestyleHint")
- .blacklist_type("nsStyleBackground")
- .blacklist_type("nsStyleBorder")
- .blacklist_type("nsStyleColor")
- .blacklist_type("nsStyleColumn")
- .blacklist_type("nsStyleContent")
- .blacklist_type("nsStyleContentData")
- .blacklist_type("nsStyleContentType")
- .blacklist_type("nsStyleContext")
- .blacklist_type("nsStyleCoord")
- .blacklist_type("nsStyleCoord_Calc")
- .blacklist_type("nsStyleCoord_CalcValue")
- .blacklist_type("nsStyleDisplay")
- .blacklist_type("nsStyleEffects")
- .blacklist_type("nsStyleFilter")
- .blacklist_type("nsStyleFont")
- .blacklist_type("nsStyleGradient")
- .blacklist_type("nsStyleGradientStop")
- .blacklist_type("nsStyleImage")
- .blacklist_type("nsStyleImageLayers")
- .blacklist_type("nsStyleImageLayers_Layer")
- .blacklist_type("nsStyleImageLayers_LayerType")
- .blacklist_type("nsStyleImageRequest")
- .blacklist_type("nsStyleList")
- .blacklist_type("nsStyleMargin")
- .blacklist_type("nsStyleOutline")
- .blacklist_type("nsStylePadding")
- .blacklist_type("nsStylePosition")
- .blacklist_type("nsStyleQuoteValues")
- .blacklist_type("nsStyleSVG")
- .blacklist_type("nsStyleSVGPaint")
- .blacklist_type("nsStyleSVGReset")
- .blacklist_type("nsStyleTable")
- .blacklist_type("nsStyleTableBorder")
- .blacklist_type("nsStyleText")
- .blacklist_type("nsStyleTextReset")
- .blacklist_type("nsStyleUIReset")
- .blacklist_type("nsStyleUnion")
- .blacklist_type("nsStyleUnit")
- .blacklist_type("nsStyleUserInterface")
- .blacklist_type("nsStyleVariables")
- .blacklist_type("nsStyleVisibility")
- .blacklist_type("nsStyleXUL")
- .blacklist_type("nsTimingFunction")
- .blacklist_type("nscolor")
- .blacklist_type("nscoord")
- .blacklist_type("nsresult")
- .blacklist_type("Loader")
- .blacklist_type("ServoStyleSheet")
- .blacklist_type("EffectCompositor_CascadeLevel")
- .blacklist_type("UpdateAnimationsTasks")
- .blacklist_type("nsTArrayBorrowed_uintptr_t")
- .blacklist_type("ServoCssRulesStrong")
- .blacklist_type("ServoCssRulesBorrowed")
- .blacklist_type("ServoCssRulesBorrowedOrNull")
- .blacklist_type("ServoCssRules")
- .blacklist_type("RawServoStyleSheetStrong")
- .blacklist_type("RawServoStyleSheetBorrowed")
- .blacklist_type("RawServoStyleSheetBorrowedOrNull")
- .blacklist_type("RawServoStyleSheet")
- .blacklist_type("ServoComputedValuesStrong")
- .blacklist_type("ServoComputedValuesBorrowed")
- .blacklist_type("ServoComputedValuesBorrowedOrNull")
- .blacklist_type("ServoComputedValues")
- .blacklist_type("RawServoDeclarationBlockStrong")
- .blacklist_type("RawServoDeclarationBlockBorrowed")
- .blacklist_type("RawServoDeclarationBlockBorrowedOrNull")
- .blacklist_type("RawServoStyleRuleStrong")
- .blacklist_type("RawServoStyleRuleBorrowed")
- .blacklist_type("RawServoStyleRuleBorrowedOrNull")
- .blacklist_type("RawServoStyleRule")
- .blacklist_type("RawServoImportRuleStrong")
- .blacklist_type("RawServoImportRuleBorrowed")
- .blacklist_type("RawServoImportRuleBorrowedOrNull")
- .blacklist_type("RawServoImportRule")
- .blacklist_type("RawServoAnimationValueStrong")
- .blacklist_type("RawServoAnimationValueBorrowed")
- .blacklist_type("RawServoAnimationValueBorrowedOrNull")
- .blacklist_type("RawServoAnimationValueMapStrong")
- .blacklist_type("RawServoAnimationValueMapBorrowed")
- .blacklist_type("RawServoAnimationValueMapBorrowedOrNull")
- .blacklist_type("RawServoMediaListStrong")
- .blacklist_type("RawServoMediaListBorrowed")
- .blacklist_type("RawServoMediaListBorrowedOrNull")
- .blacklist_type("RawServoMediaList")
- .blacklist_type("RawServoMediaRuleStrong")
- .blacklist_type("RawServoMediaRuleBorrowed")
- .blacklist_type("RawServoMediaRuleBorrowedOrNull")
- .blacklist_type("RawServoMediaRule")
- .blacklist_type("RawServoNamespaceRuleStrong")
- .blacklist_type("RawServoNamespaceRuleBorrowed")
- .blacklist_type("RawServoNamespaceRuleBorrowedOrNull")
- .blacklist_type("RawServoNamespaceRule")
- .blacklist_type("RawServoStyleSetOwned")
- .blacklist_type("RawServoStyleSetOwnedOrNull")
- .blacklist_type("RawServoStyleSetBorrowed")
- .blacklist_type("RawServoStyleSetBorrowedOrNull")
- .blacklist_type("RawServoStyleSetBorrowedMut")
- .blacklist_type("RawServoStyleSetBorrowedMutOrNull")
- .blacklist_type("RawServoStyleSet")
- .blacklist_type("StyleChildrenIteratorOwned")
- .blacklist_type("StyleChildrenIteratorOwnedOrNull")
- .blacklist_type("StyleChildrenIteratorBorrowed")
- .blacklist_type("StyleChildrenIteratorBorrowedOrNull")
- .blacklist_type("StyleChildrenIteratorBorrowedMut")
- .blacklist_type("StyleChildrenIteratorBorrowedMutOrNull")
- .blacklist_type("StyleChildrenIterator")
- .blacklist_type("ServoElementSnapshotOwned")
- .blacklist_type("ServoElementSnapshotOwnedOrNull")
- .blacklist_type("ServoElementSnapshotBorrowed")
- .blacklist_type("ServoElementSnapshotBorrowedOrNull")
- .blacklist_type("ServoElementSnapshotBorrowedMut")
- .blacklist_type("ServoElementSnapshotBorrowedMutOrNull")
- .blacklist_type("RawGeckoNodeBorrowed")
- .blacklist_type("RawGeckoNodeBorrowedOrNull")
- .blacklist_type("RawGeckoElementBorrowed")
- .blacklist_type("RawGeckoElementBorrowedOrNull")
- .blacklist_type("RawGeckoDocumentBorrowed")
- .blacklist_type("RawGeckoDocumentBorrowedOrNull")
- .blacklist_type("RawServoDeclarationBlockStrongBorrowed")
- .blacklist_type("RawServoDeclarationBlockStrongBorrowedOrNull")
- .blacklist_type("RawGeckoPresContextBorrowed")
- .blacklist_type("RawGeckoPresContextBorrowedOrNull")
- .blacklist_type("RawGeckoStyleAnimationListBorrowed")
- .blacklist_type("RawGeckoStyleAnimationListBorrowedOrNull")
- .blacklist_type("nsCSSValueBorrowed")
- .blacklist_type("nsCSSValueBorrowedOrNull")
- .blacklist_type("nsCSSValueBorrowedMut")
- .blacklist_type("nsCSSValueBorrowedMutOrNull")
- .blacklist_type("nsTimingFunctionBorrowed")
- .blacklist_type("nsTimingFunctionBorrowedOrNull")
- .blacklist_type("nsTimingFunctionBorrowedMut")
- .blacklist_type("nsTimingFunctionBorrowedMutOrNull")
- .blacklist_type("RawGeckoAnimationPropertySegmentBorrowed")
- .blacklist_type("RawGeckoAnimationPropertySegmentBorrowedOrNull")
- .blacklist_type("RawGeckoAnimationPropertySegmentBorrowedMut")
- .blacklist_type("RawGeckoAnimationPropertySegmentBorrowedMutOrNull")
- .blacklist_type("RawGeckoAnimationValueListBorrowed")
- .blacklist_type("RawGeckoAnimationValueListBorrowedOrNull")
- .blacklist_type("RawGeckoAnimationValueListBorrowedMut")
- .blacklist_type("RawGeckoAnimationValueListBorrowedMutOrNull")
- .blacklist_type("RawGeckoComputedTimingBorrowed")
- .blacklist_type("RawGeckoComputedTimingBorrowedOrNull")
- .blacklist_type("RawGeckoComputedTimingBorrowedMut")
- .blacklist_type("RawGeckoComputedTimingBorrowedMutOrNull")
- .blacklist_type("RawGeckoKeyframeListBorrowed")
- .blacklist_type("RawGeckoKeyframeListBorrowedOrNull")
- .blacklist_type("RawGeckoKeyframeListBorrowedMut")
- .blacklist_type("RawGeckoKeyframeListBorrowedMutOrNull")
- .blacklist_type("RawGeckoComputedKeyframeValuesListBorrowed")
- .blacklist_type("RawGeckoComputedKeyframeValuesListBorrowedOrNull")
- .blacklist_type("RawGeckoComputedKeyframeValuesListBorrowedMut")
- .blacklist_type("RawGeckoComputedKeyframeValuesListBorrowedMutOrNull")
- .blacklist_type("RawGeckoFontFaceRuleListBorrowed")
- .blacklist_type("RawGeckoFontFaceRuleListBorrowedOrNull")
- .blacklist_type("RawGeckoFontFaceRuleListBorrowedMut")
- .blacklist_type("RawGeckoFontFaceRuleListBorrowedMutOrNull")
+ .allowlist_function("Servo_.*")
+ .allowlist_function("Gecko_.*")
+ .blocklist_type("nsACString_internal")
+ .blocklist_type("nsAString_internal")
+ .blocklist_type("mozilla::css::URLValue")
+ .blocklist_type("RawGeckoAnimationPropertySegment")
+ .blocklist_type("RawGeckoComputedTiming")
+ .blocklist_type("RawGeckoDocument")
+ .blocklist_type("RawGeckoElement")
+ .blocklist_type("RawGeckoKeyframeList")
+ .blocklist_type("RawGeckoComputedKeyframeValuesList")
+ .blocklist_type("RawGeckoFontFaceRuleList")
+ .blocklist_type("RawGeckoNode")
+ .blocklist_type("RawGeckoAnimationValueList")
+ .blocklist_type("RawServoAnimationValue")
+ .blocklist_type("RawServoAnimationValueMap")
+ .blocklist_type("RawServoDeclarationBlock")
+ .blocklist_type("RawGeckoPresContext")
+ .blocklist_type("RawGeckoPresContextOwned")
+ .blocklist_type("RawGeckoStyleAnimationList")
+ .blocklist_type("RawGeckoURLExtraData")
+ .blocklist_type("RefPtr")
+ .blocklist_type("CSSPseudoClassType")
+ .blocklist_type("TraversalRootBehavior")
+ .blocklist_type("ComputedTimingFunction_BeforeFlag")
+ .blocklist_type("FontFamilyList")
+ .blocklist_type("FontFamilyType")
+ .blocklist_type("Keyframe")
+ .blocklist_type("ServoBundledURI")
+ .blocklist_type("ServoElementSnapshot")
+ .blocklist_type("SheetParsingMode")
+ .blocklist_type("StyleBasicShape")
+ .blocklist_type("StyleBasicShapeType")
+ .blocklist_type("StyleShapeSource")
+ .blocklist_type("nsCSSFontFaceRule")
+ .blocklist_type("nsCSSKeyword")
+ .blocklist_type("nsCSSPropertyID")
+ .blocklist_type("nsCSSShadowArray")
+ .blocklist_type("nsCSSUnit")
+ .blocklist_type("nsCSSValue")
+ .blocklist_type("nsCSSValueSharedList")
+ .blocklist_type("nsChangeHint")
+ .blocklist_type("nsCursorImage")
+ .blocklist_type("nsFont")
+ .blocklist_type("nsIAtom")
+ .blocklist_type("nsMediaFeature")
+ .blocklist_type("nsRestyleHint")
+ .blocklist_type("nsStyleBackground")
+ .blocklist_type("nsStyleBorder")
+ .blocklist_type("nsStyleColor")
+ .blocklist_type("nsStyleColumn")
+ .blocklist_type("nsStyleContent")
+ .blocklist_type("nsStyleContentData")
+ .blocklist_type("nsStyleContentType")
+ .blocklist_type("nsStyleContext")
+ .blocklist_type("nsStyleCoord")
+ .blocklist_type("nsStyleCoord_Calc")
+ .blocklist_type("nsStyleCoord_CalcValue")
+ .blocklist_type("nsStyleDisplay")
+ .blocklist_type("nsStyleEffects")
+ .blocklist_type("nsStyleFilter")
+ .blocklist_type("nsStyleFont")
+ .blocklist_type("nsStyleGradient")
+ .blocklist_type("nsStyleGradientStop")
+ .blocklist_type("nsStyleImage")
+ .blocklist_type("nsStyleImageLayers")
+ .blocklist_type("nsStyleImageLayers_Layer")
+ .blocklist_type("nsStyleImageLayers_LayerType")
+ .blocklist_type("nsStyleImageRequest")
+ .blocklist_type("nsStyleList")
+ .blocklist_type("nsStyleMargin")
+ .blocklist_type("nsStyleOutline")
+ .blocklist_type("nsStylePadding")
+ .blocklist_type("nsStylePosition")
+ .blocklist_type("nsStyleQuoteValues")
+ .blocklist_type("nsStyleSVG")
+ .blocklist_type("nsStyleSVGPaint")
+ .blocklist_type("nsStyleSVGReset")
+ .blocklist_type("nsStyleTable")
+ .blocklist_type("nsStyleTableBorder")
+ .blocklist_type("nsStyleText")
+ .blocklist_type("nsStyleTextReset")
+ .blocklist_type("nsStyleUIReset")
+ .blocklist_type("nsStyleUnion")
+ .blocklist_type("nsStyleUnit")
+ .blocklist_type("nsStyleUserInterface")
+ .blocklist_type("nsStyleVariables")
+ .blocklist_type("nsStyleVisibility")
+ .blocklist_type("nsStyleXUL")
+ .blocklist_type("nsTimingFunction")
+ .blocklist_type("nscolor")
+ .blocklist_type("nscoord")
+ .blocklist_type("nsresult")
+ .blocklist_type("Loader")
+ .blocklist_type("ServoStyleSheet")
+ .blocklist_type("EffectCompositor_CascadeLevel")
+ .blocklist_type("UpdateAnimationsTasks")
+ .blocklist_type("nsTArrayBorrowed_uintptr_t")
+ .blocklist_type("ServoCssRulesStrong")
+ .blocklist_type("ServoCssRulesBorrowed")
+ .blocklist_type("ServoCssRulesBorrowedOrNull")
+ .blocklist_type("ServoCssRules")
+ .blocklist_type("RawServoStyleSheetStrong")
+ .blocklist_type("RawServoStyleSheetBorrowed")
+ .blocklist_type("RawServoStyleSheetBorrowedOrNull")
+ .blocklist_type("RawServoStyleSheet")
+ .blocklist_type("ServoComputedValuesStrong")
+ .blocklist_type("ServoComputedValuesBorrowed")
+ .blocklist_type("ServoComputedValuesBorrowedOrNull")
+ .blocklist_type("ServoComputedValues")
+ .blocklist_type("RawServoDeclarationBlockStrong")
+ .blocklist_type("RawServoDeclarationBlockBorrowed")
+ .blocklist_type("RawServoDeclarationBlockBorrowedOrNull")
+ .blocklist_type("RawServoStyleRuleStrong")
+ .blocklist_type("RawServoStyleRuleBorrowed")
+ .blocklist_type("RawServoStyleRuleBorrowedOrNull")
+ .blocklist_type("RawServoStyleRule")
+ .blocklist_type("RawServoImportRuleStrong")
+ .blocklist_type("RawServoImportRuleBorrowed")
+ .blocklist_type("RawServoImportRuleBorrowedOrNull")
+ .blocklist_type("RawServoImportRule")
+ .blocklist_type("RawServoAnimationValueStrong")
+ .blocklist_type("RawServoAnimationValueBorrowed")
+ .blocklist_type("RawServoAnimationValueBorrowedOrNull")
+ .blocklist_type("RawServoAnimationValueMapStrong")
+ .blocklist_type("RawServoAnimationValueMapBorrowed")
+ .blocklist_type("RawServoAnimationValueMapBorrowedOrNull")
+ .blocklist_type("RawServoMediaListStrong")
+ .blocklist_type("RawServoMediaListBorrowed")
+ .blocklist_type("RawServoMediaListBorrowedOrNull")
+ .blocklist_type("RawServoMediaList")
+ .blocklist_type("RawServoMediaRuleStrong")
+ .blocklist_type("RawServoMediaRuleBorrowed")
+ .blocklist_type("RawServoMediaRuleBorrowedOrNull")
+ .blocklist_type("RawServoMediaRule")
+ .blocklist_type("RawServoNamespaceRuleStrong")
+ .blocklist_type("RawServoNamespaceRuleBorrowed")
+ .blocklist_type("RawServoNamespaceRuleBorrowedOrNull")
+ .blocklist_type("RawServoNamespaceRule")
+ .blocklist_type("RawServoStyleSetOwned")
+ .blocklist_type("RawServoStyleSetOwnedOrNull")
+ .blocklist_type("RawServoStyleSetBorrowed")
+ .blocklist_type("RawServoStyleSetBorrowedOrNull")
+ .blocklist_type("RawServoStyleSetBorrowedMut")
+ .blocklist_type("RawServoStyleSetBorrowedMutOrNull")
+ .blocklist_type("RawServoStyleSet")
+ .blocklist_type("StyleChildrenIteratorOwned")
+ .blocklist_type("StyleChildrenIteratorOwnedOrNull")
+ .blocklist_type("StyleChildrenIteratorBorrowed")
+ .blocklist_type("StyleChildrenIteratorBorrowedOrNull")
+ .blocklist_type("StyleChildrenIteratorBorrowedMut")
+ .blocklist_type("StyleChildrenIteratorBorrowedMutOrNull")
+ .blocklist_type("StyleChildrenIterator")
+ .blocklist_type("ServoElementSnapshotOwned")
+ .blocklist_type("ServoElementSnapshotOwnedOrNull")
+ .blocklist_type("ServoElementSnapshotBorrowed")
+ .blocklist_type("ServoElementSnapshotBorrowedOrNull")
+ .blocklist_type("ServoElementSnapshotBorrowedMut")
+ .blocklist_type("ServoElementSnapshotBorrowedMutOrNull")
+ .blocklist_type("RawGeckoNodeBorrowed")
+ .blocklist_type("RawGeckoNodeBorrowedOrNull")
+ .blocklist_type("RawGeckoElementBorrowed")
+ .blocklist_type("RawGeckoElementBorrowedOrNull")
+ .blocklist_type("RawGeckoDocumentBorrowed")
+ .blocklist_type("RawGeckoDocumentBorrowedOrNull")
+ .blocklist_type("RawServoDeclarationBlockStrongBorrowed")
+ .blocklist_type("RawServoDeclarationBlockStrongBorrowedOrNull")
+ .blocklist_type("RawGeckoPresContextBorrowed")
+ .blocklist_type("RawGeckoPresContextBorrowedOrNull")
+ .blocklist_type("RawGeckoStyleAnimationListBorrowed")
+ .blocklist_type("RawGeckoStyleAnimationListBorrowedOrNull")
+ .blocklist_type("nsCSSValueBorrowed")
+ .blocklist_type("nsCSSValueBorrowedOrNull")
+ .blocklist_type("nsCSSValueBorrowedMut")
+ .blocklist_type("nsCSSValueBorrowedMutOrNull")
+ .blocklist_type("nsTimingFunctionBorrowed")
+ .blocklist_type("nsTimingFunctionBorrowedOrNull")
+ .blocklist_type("nsTimingFunctionBorrowedMut")
+ .blocklist_type("nsTimingFunctionBorrowedMutOrNull")
+ .blocklist_type("RawGeckoAnimationPropertySegmentBorrowed")
+ .blocklist_type("RawGeckoAnimationPropertySegmentBorrowedOrNull")
+ .blocklist_type("RawGeckoAnimationPropertySegmentBorrowedMut")
+ .blocklist_type("RawGeckoAnimationPropertySegmentBorrowedMutOrNull")
+ .blocklist_type("RawGeckoAnimationValueListBorrowed")
+ .blocklist_type("RawGeckoAnimationValueListBorrowedOrNull")
+ .blocklist_type("RawGeckoAnimationValueListBorrowedMut")
+ .blocklist_type("RawGeckoAnimationValueListBorrowedMutOrNull")
+ .blocklist_type("RawGeckoComputedTimingBorrowed")
+ .blocklist_type("RawGeckoComputedTimingBorrowedOrNull")
+ .blocklist_type("RawGeckoComputedTimingBorrowedMut")
+ .blocklist_type("RawGeckoComputedTimingBorrowedMutOrNull")
+ .blocklist_type("RawGeckoKeyframeListBorrowed")
+ .blocklist_type("RawGeckoKeyframeListBorrowedOrNull")
+ .blocklist_type("RawGeckoKeyframeListBorrowedMut")
+ .blocklist_type("RawGeckoKeyframeListBorrowedMutOrNull")
+ .blocklist_type("RawGeckoComputedKeyframeValuesListBorrowed")
+ .blocklist_type("RawGeckoComputedKeyframeValuesListBorrowedOrNull")
+ .blocklist_type("RawGeckoComputedKeyframeValuesListBorrowedMut")
+ .blocklist_type("RawGeckoComputedKeyframeValuesListBorrowedMutOrNull")
+ .blocklist_type("RawGeckoFontFaceRuleListBorrowed")
+ .blocklist_type("RawGeckoFontFaceRuleListBorrowedOrNull")
+ .blocklist_type("RawGeckoFontFaceRuleListBorrowedMut")
+ .blocklist_type("RawGeckoFontFaceRuleListBorrowedMutOrNull")
.raw_line(r#"pub use nsstring::{nsACString, nsAString, nsString};"#)
.raw_line(r#"type nsACString_internal = nsACString;"#)
.raw_line(r#"type nsAString_internal = nsAString;"#)