summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml11
-rw-r--r--CONTRIBUTING.md31
-rw-r--r--Cargo.toml4
-rw-r--r--bindgen-integration/Cargo.toml4
-rw-r--r--src/main.rs5
-rw-r--r--tests/expectations/tests/16-byte-alignment.rs2
-rw-r--r--tests/expectations/tests/381-decltype-alias.rs2
-rw-r--r--tests/expectations/tests/accessors.rs2
-rw-r--r--tests/expectations/tests/annotation_hide.rs2
-rw-r--r--tests/expectations/tests/anon_enum.rs2
-rw-r--r--tests/expectations/tests/anon_enum_trait.rs2
-rw-r--r--tests/expectations/tests/anon_enum_whitelist.rs2
-rw-r--r--tests/expectations/tests/anon_struct_in_union.rs2
-rw-r--r--tests/expectations/tests/anon_union.rs2
-rw-r--r--tests/expectations/tests/anonymous-template-types.rs2
-rw-r--r--tests/expectations/tests/arg_keyword.rs2
-rw-r--r--tests/expectations/tests/bad-namespace-parenthood-inheritance.rs2
-rw-r--r--tests/expectations/tests/base-to-derived.rs2
-rw-r--r--tests/expectations/tests/bitfield-enum-basic.rs2
-rw-r--r--tests/expectations/tests/bitfield-large.rs2
-rw-r--r--tests/expectations/tests/bitfield-method-same-name.rs2
-rw-r--r--tests/expectations/tests/bitfield_align.rs2
-rw-r--r--tests/expectations/tests/bitfield_method_mangling.rs2
-rw-r--r--tests/expectations/tests/blocks.rs2
-rw-r--r--tests/expectations/tests/builtin-template.rs2
-rw-r--r--tests/expectations/tests/c-empty-layout.rs2
-rw-r--r--tests/expectations/tests/canonical_path_without_namespacing.rs2
-rw-r--r--tests/expectations/tests/char.rs2
-rw-r--r--tests/expectations/tests/class.rs2
-rw-r--r--tests/expectations/tests/class_nested.rs2
-rw-r--r--tests/expectations/tests/class_no_members.rs2
-rw-r--r--tests/expectations/tests/class_static.rs2
-rw-r--r--tests/expectations/tests/class_static_const.rs2
-rw-r--r--tests/expectations/tests/class_use_as.rs2
-rw-r--r--tests/expectations/tests/class_with_dtor.rs2
-rw-r--r--tests/expectations/tests/class_with_inner_struct.rs2
-rw-r--r--tests/expectations/tests/class_with_typedef.rs2
-rw-r--r--tests/expectations/tests/complex.rs2
-rw-r--r--tests/expectations/tests/complex_global.rs2
-rw-r--r--tests/expectations/tests/const_array_fn_arg.rs2
-rw-r--r--tests/expectations/tests/const_enum_unnamed.rs2
-rw-r--r--tests/expectations/tests/const_ptr.rs2
-rw-r--r--tests/expectations/tests/const_resolved_ty.rs2
-rw-r--r--tests/expectations/tests/const_tparam.rs2
-rw-r--r--tests/expectations/tests/constant-non-specialized-tp.rs2
-rw-r--r--tests/expectations/tests/constify-all-enums.rs2
-rw-r--r--tests/expectations/tests/constify-enum.rs2
-rw-r--r--tests/expectations/tests/constructor-tp.rs2
-rw-r--r--tests/expectations/tests/constructors.rs2
-rw-r--r--tests/expectations/tests/convert-floats.rs2
-rw-r--r--tests/expectations/tests/cpp-empty-layout.rs2
-rw-r--r--tests/expectations/tests/crtp.rs2
-rw-r--r--tests/expectations/tests/dash_language.rs2
-rw-r--r--tests/expectations/tests/decl_extern_int_twice.rs2
-rw-r--r--tests/expectations/tests/decl_ptr_to_array.rs2
-rw-r--r--tests/expectations/tests/default-template-parameter.rs2
-rw-r--r--tests/expectations/tests/derive-fn-ptr.rs2
-rw-r--r--tests/expectations/tests/disable-namespacing.rs2
-rw-r--r--tests/expectations/tests/duplicated-namespaces-definitions.rs2
-rw-r--r--tests/expectations/tests/duplicated-namespaces.rs2
-rw-r--r--tests/expectations/tests/duplicated_constants_in_ns.rs2
-rw-r--r--tests/expectations/tests/elaborated.rs2
-rw-r--r--tests/expectations/tests/empty_template_param_name.rs2
-rw-r--r--tests/expectations/tests/enum.rs2
-rw-r--r--tests/expectations/tests/enum_alias.rs2
-rw-r--r--tests/expectations/tests/enum_and_vtable_mangling.rs2
-rw-r--r--tests/expectations/tests/enum_dupe.rs2
-rw-r--r--tests/expectations/tests/enum_explicit_type.rs2
-rw-r--r--tests/expectations/tests/enum_in_template_with_typedef.rs2
-rw-r--r--tests/expectations/tests/enum_negative.rs2
-rw-r--r--tests/expectations/tests/enum_packed.rs2
-rw-r--r--tests/expectations/tests/eval-variadic-template-parameter.rs2
-rw-r--r--tests/expectations/tests/extern.rs2
-rw-r--r--tests/expectations/tests/float128.rs2
-rw-r--r--tests/expectations/tests/forward-declaration-autoptr.rs2
-rw-r--r--tests/expectations/tests/forward-enum-decl.rs2
-rw-r--r--tests/expectations/tests/forward-inherit-struct-with-fields.rs2
-rw-r--r--tests/expectations/tests/forward-inherit-struct.rs2
-rw-r--r--tests/expectations/tests/forward_declared_complex_types.rs2
-rw-r--r--tests/expectations/tests/forward_declared_struct.rs2
-rw-r--r--tests/expectations/tests/func_proto.rs2
-rw-r--r--tests/expectations/tests/func_ptr.rs2
-rw-r--r--tests/expectations/tests/func_ptr_in_struct.rs2
-rw-r--r--tests/expectations/tests/func_with_array_arg.rs2
-rw-r--r--tests/expectations/tests/func_with_func_ptr_arg.rs2
-rw-r--r--tests/expectations/tests/gen-constructors-neg.rs2
-rw-r--r--tests/expectations/tests/gen-constructors.rs2
-rw-r--r--tests/expectations/tests/gen-destructors-neg.rs2
-rw-r--r--tests/expectations/tests/gen-destructors.rs2
-rw-r--r--tests/expectations/tests/generate-inline.rs2
-rw-r--r--tests/expectations/tests/in_class_typedef.rs2
-rw-r--r--tests/expectations/tests/infinite-macro.rs2
-rw-r--r--tests/expectations/tests/inherit-namespaced.rs2
-rw-r--r--tests/expectations/tests/inherit_named.rs2
-rw-r--r--tests/expectations/tests/inherit_typedef.rs2
-rw-r--r--tests/expectations/tests/inline-function.rs2
-rw-r--r--tests/expectations/tests/inline_namespace.rs2
-rw-r--r--tests/expectations/tests/inline_namespace_conservative.rs2
-rw-r--r--tests/expectations/tests/inline_namespace_whitelist.rs2
-rw-r--r--tests/expectations/tests/inner_const.rs2
-rw-r--r--tests/expectations/tests/inner_template_self.rs2
-rw-r--r--tests/expectations/tests/int128_t.rs2
-rw-r--r--tests/expectations/tests/issue-358.rs2
-rw-r--r--tests/expectations/tests/issue-372.rs2
-rw-r--r--tests/expectations/tests/issue-410.rs2
-rw-r--r--tests/expectations/tests/issue-446.rs2
-rw-r--r--tests/expectations/tests/issue-447.rs2
-rw-r--r--tests/expectations/tests/issue-493.rs2
-rw-r--r--tests/expectations/tests/issue-544-stylo-creduce-2.rs2
-rw-r--r--tests/expectations/tests/issue-544-stylo-creduce.rs2
-rw-r--r--tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs2
-rw-r--r--tests/expectations/tests/issue-573-layout-test-failures.rs2
-rw-r--r--tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs2
-rw-r--r--tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs2
-rw-r--r--tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs2
-rw-r--r--tests/expectations/tests/issue-639-typedef-anon-field.rs2
-rw-r--r--tests/expectations/tests/issue-643-inner-struct.rs2
-rw-r--r--tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs2
-rw-r--r--tests/expectations/tests/issue-654-struct-fn-collision.rs2
-rw-r--r--tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs2
-rw-r--r--tests/expectations/tests/issue-662-part-2.rs2
-rw-r--r--tests/expectations/tests/issue-674-1.rs2
-rw-r--r--tests/expectations/tests/issue-674-2.rs2
-rw-r--r--tests/expectations/tests/issue-674-3.rs2
-rw-r--r--tests/expectations/tests/issue-677-nested-ns-specifier.rs2
-rw-r--r--tests/expectations/tests/issue-691-template-parameter-virtual.rs2
-rw-r--r--tests/expectations/tests/issue_311.rs2
-rw-r--r--tests/expectations/tests/issue_315.rs2
-rw-r--r--tests/expectations/tests/jsval_layout_opaque.rs2
-rw-r--r--tests/expectations/tests/keywords.rs2
-rw-r--r--tests/expectations/tests/layout.rs2
-rw-r--r--tests/expectations/tests/layout_align.rs2
-rw-r--r--tests/expectations/tests/layout_arp.rs2
-rw-r--r--tests/expectations/tests/layout_array.rs2
-rw-r--r--tests/expectations/tests/layout_array_too_long.rs2
-rw-r--r--tests/expectations/tests/layout_cmdline_token.rs2
-rw-r--r--tests/expectations/tests/layout_eth_conf.rs2
-rw-r--r--tests/expectations/tests/layout_kni_mbuf.rs2
-rw-r--r--tests/expectations/tests/layout_large_align_field.rs2
-rw-r--r--tests/expectations/tests/layout_mbuf.rs2
-rw-r--r--tests/expectations/tests/libclang-3.8/auto.rs34
-rw-r--r--tests/expectations/tests/libclang-3.8/call-conv-field.rs42
-rw-r--r--tests/expectations/tests/libclang-3.8/const_bool.rs34
-rw-r--r--tests/expectations/tests/libclang-3.8/constant-evaluate.rs41
-rw-r--r--tests/expectations/tests/libclang-3.8/objc_template.rs (renamed from tests/expectations/tests/objc_template.rs)2
-rw-r--r--tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs56
-rw-r--r--tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs (renamed from tests/expectations/tests/type_alias_template_specialized.rs)2
-rw-r--r--tests/expectations/tests/libclang-3.9/auto.rs (renamed from tests/expectations/tests/auto.rs)2
-rw-r--r--tests/expectations/tests/libclang-3.9/call-conv-field.rs (renamed from tests/expectations/tests/call-conv-field.rs)2
-rw-r--r--tests/expectations/tests/libclang-3.9/const_bool.rs (renamed from tests/expectations/tests/const_bool.rs)2
-rw-r--r--tests/expectations/tests/libclang-3.9/constant-evaluate.rs (renamed from tests/expectations/tests/constant-evaluate.rs)2
-rw-r--r--tests/expectations/tests/libclang-3.9/objc_template.rs18
-rw-r--r--tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs (renamed from tests/expectations/tests/partial-specialization-and-inheritance.rs)2
-rw-r--r--tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs28
-rw-r--r--tests/expectations/tests/libclang-4/auto.rs31
-rw-r--r--tests/expectations/tests/libclang-4/call-conv-field.rs42
-rw-r--r--tests/expectations/tests/libclang-4/const_bool.rs25
-rw-r--r--tests/expectations/tests/libclang-4/constant-evaluate.rs20
-rw-r--r--tests/expectations/tests/libclang-4/objc_template.rs18
-rw-r--r--tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs44
-rw-r--r--tests/expectations/tests/libclang-4/type_alias_template_specialized.rs31
-rw-r--r--tests/expectations/tests/macro-expr-basic.rs2
-rw-r--r--tests/expectations/tests/macro-redef.rs2
-rw-r--r--tests/expectations/tests/macro_const.rs2
-rw-r--r--tests/expectations/tests/maddness-is-avoidable.rs2
-rw-r--r--tests/expectations/tests/method-mangling.rs2
-rw-r--r--tests/expectations/tests/module-whitelisted.rs2
-rw-r--r--tests/expectations/tests/msvc-no-usr.rs2
-rw-r--r--tests/expectations/tests/multiple-inherit-empty-correct-layout.rs2
-rw-r--r--tests/expectations/tests/mutable.rs2
-rw-r--r--tests/expectations/tests/namespace.rs2
-rw-r--r--tests/expectations/tests/nested.rs2
-rw-r--r--tests/expectations/tests/nested_vtable.rs2
-rw-r--r--tests/expectations/tests/nested_within_namespace.rs2
-rw-r--r--tests/expectations/tests/no-comments.rs2
-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-recursive-whitelisting.rs2
-rw-r--r--tests/expectations/tests/no-std.rs2
-rw-r--r--tests/expectations/tests/no_copy.rs2
-rw-r--r--tests/expectations/tests/non-type-params.rs2
-rw-r--r--tests/expectations/tests/nsStyleAutoArray.rs2
-rw-r--r--tests/expectations/tests/objc_category.rs2
-rw-r--r--tests/expectations/tests/objc_class.rs2
-rw-r--r--tests/expectations/tests/objc_class_method.rs2
-rw-r--r--tests/expectations/tests/objc_interface.rs2
-rw-r--r--tests/expectations/tests/objc_interface_type.rs2
-rw-r--r--tests/expectations/tests/objc_method.rs2
-rw-r--r--tests/expectations/tests/objc_method_clash.rs2
-rw-r--r--tests/expectations/tests/objc_property_fnptr.rs2
-rw-r--r--tests/expectations/tests/objc_protocol.rs2
-rw-r--r--tests/expectations/tests/objc_sel_and_id.rs2
-rw-r--r--tests/expectations/tests/objc_whitelist.rs2
-rw-r--r--tests/expectations/tests/only_bitfields.rs2
-rw-r--r--tests/expectations/tests/opaque-tracing.rs2
-rw-r--r--tests/expectations/tests/opaque_in_struct.rs2
-rw-r--r--tests/expectations/tests/opaque_pointer.rs2
-rw-r--r--tests/expectations/tests/opaque_typedef.rs2
-rw-r--r--tests/expectations/tests/overflowed_enum.rs2
-rw-r--r--tests/expectations/tests/overloading.rs2
-rw-r--r--tests/expectations/tests/prepend_enum_name.rs2
-rw-r--r--tests/expectations/tests/private.rs2
-rw-r--r--tests/expectations/tests/public-dtor.rs2
-rw-r--r--tests/expectations/tests/redeclaration.rs2
-rw-r--r--tests/expectations/tests/ref_argument_array.rs2
-rw-r--r--tests/expectations/tests/reparented_replacement.rs2
-rw-r--r--tests/expectations/tests/replace_template_alias.rs2
-rw-r--r--tests/expectations/tests/replace_use.rs2
-rw-r--r--tests/expectations/tests/replaces_double.rs2
-rw-r--r--tests/expectations/tests/resolved_type_def_function.rs2
-rw-r--r--tests/expectations/tests/same_struct_name_in_different_namespaces.rs2
-rw-r--r--tests/expectations/tests/short-enums.rs2
-rw-r--r--tests/expectations/tests/size_t_template.rs2
-rw-r--r--tests/expectations/tests/struct_containing_forward_declared_struct.rs2
-rw-r--r--tests/expectations/tests/struct_typedef.rs2
-rw-r--r--tests/expectations/tests/struct_typedef_ns.rs2
-rw-r--r--tests/expectations/tests/struct_with_anon_struct.rs2
-rw-r--r--tests/expectations/tests/struct_with_anon_struct_array.rs2
-rw-r--r--tests/expectations/tests/struct_with_anon_struct_pointer.rs2
-rw-r--r--tests/expectations/tests/struct_with_anon_union.rs2
-rw-r--r--tests/expectations/tests/struct_with_anon_unnamed_struct.rs2
-rw-r--r--tests/expectations/tests/struct_with_anon_unnamed_union.rs2
-rw-r--r--tests/expectations/tests/struct_with_bitfields.rs2
-rw-r--r--tests/expectations/tests/struct_with_derive_debug.rs2
-rw-r--r--tests/expectations/tests/struct_with_nesting.rs2
-rw-r--r--tests/expectations/tests/struct_with_packing.rs2
-rw-r--r--tests/expectations/tests/struct_with_struct.rs2
-rw-r--r--tests/expectations/tests/struct_with_typedef_template_arg.rs2
-rw-r--r--tests/expectations/tests/template-fun-ty.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-0.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-1.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-10.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-11.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-12.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-13.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-14.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-15.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-2.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-3.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-4.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-5.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-6.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-7.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-8.rs2
-rw-r--r--tests/expectations/tests/template-param-usage-9.rs2
-rw-r--r--tests/expectations/tests/template.rs2
-rw-r--r--tests/expectations/tests/template_alias.rs2
-rw-r--r--tests/expectations/tests/template_alias_basic.rs2
-rw-r--r--tests/expectations/tests/template_alias_namespace.rs2
-rw-r--r--tests/expectations/tests/template_partial_specification.rs2
-rw-r--r--tests/expectations/tests/template_typedef_transitive_param.rs2
-rw-r--r--tests/expectations/tests/template_typedefs.rs2
-rw-r--r--tests/expectations/tests/templateref_opaque.rs2
-rw-r--r--tests/expectations/tests/type-referenced-by-whitelisted-function.rs2
-rw-r--r--tests/expectations/tests/type_alias_empty.rs2
-rw-r--r--tests/expectations/tests/type_alias_partial_template_especialization.rs2
-rw-r--r--tests/expectations/tests/typedefd-array-as-function-arg.rs2
-rw-r--r--tests/expectations/tests/typeref.rs2
-rw-r--r--tests/expectations/tests/union-in-ns.rs2
-rw-r--r--tests/expectations/tests/union_dtor.rs2
-rw-r--r--tests/expectations/tests/union_fields.rs2
-rw-r--r--tests/expectations/tests/union_template.rs2
-rw-r--r--tests/expectations/tests/union_with_anon_struct.rs2
-rw-r--r--tests/expectations/tests/union_with_anon_struct_bitfield.rs2
-rw-r--r--tests/expectations/tests/union_with_anon_union.rs2
-rw-r--r--tests/expectations/tests/union_with_anon_unnamed_struct.rs2
-rw-r--r--tests/expectations/tests/union_with_anon_unnamed_union.rs2
-rw-r--r--tests/expectations/tests/union_with_big_member.rs2
-rw-r--r--tests/expectations/tests/union_with_nesting.rs2
-rw-r--r--tests/expectations/tests/unknown_attr.rs2
-rw-r--r--tests/expectations/tests/use-core.rs2
-rw-r--r--tests/expectations/tests/using.rs2
-rw-r--r--tests/expectations/tests/var-tracing.rs2
-rw-r--r--tests/expectations/tests/variadic-method.rs2
-rw-r--r--tests/expectations/tests/variadic_template_function.rs2
-rw-r--r--tests/expectations/tests/vector.rs2
-rw-r--r--tests/expectations/tests/virtual_dtor.rs2
-rw-r--r--tests/expectations/tests/virtual_inheritance.rs2
-rw-r--r--tests/expectations/tests/virtual_overloaded.rs2
-rw-r--r--tests/expectations/tests/vtable_recursive_sig.rs2
-rw-r--r--tests/expectations/tests/weird_bitfields.rs2
-rw-r--r--tests/expectations/tests/what_is_going_on.rs2
-rw-r--r--tests/expectations/tests/whitelist-namespaces-basic.rs2
-rw-r--r--tests/expectations/tests/whitelist-namespaces.rs2
-rw-r--r--tests/expectations/tests/whitelist_basic.rs2
-rw-r--r--tests/expectations/tests/whitelist_fix.rs2
-rw-r--r--tests/expectations/tests/whitelist_vars.rs2
-rwxr-xr-xtests/stylo_sanity.rs4
-rwxr-xr-xtests/test-one.sh2
-rw-r--r--tests/tests.rs29
290 files changed, 806 insertions, 284 deletions
diff --git a/.travis.yml b/.travis.yml
index f66c7d36..f3c48c7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,16 +17,15 @@ env:
global:
- CARGO_TARGET_DIR=/tmp/bindgen
matrix:
- - LLVM_VERSION=3.7.1 BINDGEN_FEATURES=testing_only_llvm_stable
- - LLVM_VERSION=3.8.1 BINDGEN_FEATURES=testing_only_llvm_stable
- - LLVM_VERSION=3.9.0 BINDGEN_FEATURES=
- - LLVM_VERSION=4.0.0 BINDGEN_FEATURES=
+ - LLVM_VERSION=3.7.1 BINDGEN_FEATURES=testing_only_libclang_3_8
+ - LLVM_VERSION=3.8.1 BINDGEN_FEATURES=testing_only_libclang_3_8
+ - LLVM_VERSION=3.9.0 BINDGEN_FEATURES=testing_only_libclang_3_9
+ - LLVM_VERSION=4.0.0 BINDGEN_FEATURES=testing_only_libclang_4
matrix:
fast_finish: true
allow_failures:
- - env: LLVM_VERSION=4.0.0 BINDGEN_FEATURES=
- - env: LLVM_VERSION=3.7.1 BINDGEN_FEATURES=testing_only_llvm_stable
+ - env: LLVM_VERSION=3.7.1 BINDGEN_FEATURES=testing_only_libclang_3_8
cache:
directories:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1d78497e..bc5c883d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -14,7 +14,9 @@ out to us in a GitHub issue, or stop by
- [Testing](#testing)
- [Overview](#overview)
- [Running All Tests](#running-all-tests)
+ - [Running a Single Test](#running-a-single-test)
- [Authoring New Tests](#authoring-new-tests)
+ - [Test Expectations and `libclang` Versions](#test-expectations-and-libclang-versions)
- [Automatic code formatting](#automatic-code-formatting)
- [Generating Graphviz Dot Files](#generating-graphviz-dot-files)
- [Debug Logging](#debug-logging)
@@ -91,9 +93,17 @@ Run `cargo test` to compare generated Rust bindings to the expectations.
### Running All Tests
```
-$ cargo test [--all-features]
+$ cargo test --features testing_only_libclang_$VERSION
```
+Where `$VERSION` is one of:
+
+* `4`
+* `3_9`
+* `3_8`
+
+depending on which version of `libclang` you have installed.
+
### Running a Single Test
To generate bindings for a single test header, compile the bindings, and run the
@@ -124,6 +134,25 @@ Then verify the new Rust bindings compile and pass some basic tests:
$ cargo test -p tests_expectations
```
+### Test Expectations and `libclang` Versions
+
+If a test generates different bindings across different `libclang` versions (for
+example, because we take advantage of better/newer APIs when possible), then you
+can add multiple test expectations, one for each supported `libclang`
+version. Instead of having a single `tests/expectations/tests/my_test.rs` file,
+add each of:
+
+* `tests/expectations/tests/libclang-4/my_test.rs`
+* `tests/expectations/tests/libclang-3.9/my_test.rs`
+* `tests/expectations/tests/libclang-3.8/my_test.rs`
+
+If you need to update the test expectations for a test file that generates
+different bindings for different `libclang` versions, you *don't* need to have
+many version of `libclang` installed locally. Just make a work-in-progress pull
+request, and then when Travis CI fails, it will log a diff of the
+expectations. Use the diff to patch the appropriate expectation file locally and
+then update your pull request.
+
## Automatic code formatting
We use [`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) to enforce a
diff --git a/Cargo.toml b/Cargo.toml
index 8d477662..4dd3fe31 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -77,4 +77,6 @@ static = []
# on bindgen!
testing_only_docs = []
testing_only_extra_assertions = []
-testing_only_llvm_stable = []
+testing_only_libclang_4 = []
+testing_only_libclang_3_9 = []
+testing_only_libclang_3_8 = []
diff --git a/bindgen-integration/Cargo.toml b/bindgen-integration/Cargo.toml
index 3b1083d4..304d1b0d 100644
--- a/bindgen-integration/Cargo.toml
+++ b/bindgen-integration/Cargo.toml
@@ -11,4 +11,6 @@ bindgen = { path = ".." }
gcc = "0.3"
[features]
-testing_only_llvm_stable = ["bindgen/testing_only_llvm_stable"]
+testing_only_libclang_4 = ["bindgen/testing_only_libclang_4"]
+testing_only_libclang_3_9 = ["bindgen/testing_only_libclang_3_9"]
+testing_only_libclang_3_8 = ["bindgen/testing_only_libclang_3_8"]
diff --git a/src/main.rs b/src/main.rs
index 603a6555..f202cc18 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -31,9 +31,12 @@ pub fn main() {
let bind_args: Vec<_> = env::args().collect();
let version = clang_version();
- let expected_version = if cfg!(feature = "testing_only_llvm_stable") {
+ let expected_version = if cfg!(feature = "testing_only_libclang_4") {
+ (4, 0)
+ } else if cfg!(feature = "testing_only_libclang_3_8") {
(3, 8)
} else {
+ // Default to 3.9.
(3, 9)
};
diff --git a/tests/expectations/tests/16-byte-alignment.rs b/tests/expectations/tests/16-byte-alignment.rs
index 2ab00679..c60d69c3 100644
--- a/tests/expectations/tests/16-byte-alignment.rs
+++ b/tests/expectations/tests/16-byte-alignment.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/381-decltype-alias.rs b/tests/expectations/tests/381-decltype-alias.rs
index 632cdd31..7f2bb878 100644
--- a/tests/expectations/tests/381-decltype-alias.rs
+++ b/tests/expectations/tests/381-decltype-alias.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/accessors.rs b/tests/expectations/tests/accessors.rs
index 753188bd..ac02e711 100644
--- a/tests/expectations/tests/accessors.rs
+++ b/tests/expectations/tests/accessors.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/annotation_hide.rs b/tests/expectations/tests/annotation_hide.rs
index 1ad8fd83..0b669041 100644
--- a/tests/expectations/tests/annotation_hide.rs
+++ b/tests/expectations/tests/annotation_hide.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/**
diff --git a/tests/expectations/tests/anon_enum.rs b/tests/expectations/tests/anon_enum.rs
index 71abc77b..715688ff 100644
--- a/tests/expectations/tests/anon_enum.rs
+++ b/tests/expectations/tests/anon_enum.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/anon_enum_trait.rs b/tests/expectations/tests/anon_enum_trait.rs
index 92c697a8..699d49c2 100644
--- a/tests/expectations/tests/anon_enum_trait.rs
+++ b/tests/expectations/tests/anon_enum_trait.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/anon_enum_whitelist.rs b/tests/expectations/tests/anon_enum_whitelist.rs
index b32396a0..d3f54275 100644
--- a/tests/expectations/tests/anon_enum_whitelist.rs
+++ b/tests/expectations/tests/anon_enum_whitelist.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const NODE_FLAG_FOO: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_FOO;
diff --git a/tests/expectations/tests/anon_struct_in_union.rs b/tests/expectations/tests/anon_struct_in_union.rs
index 97a342cf..bfb10015 100644
--- a/tests/expectations/tests/anon_struct_in_union.rs
+++ b/tests/expectations/tests/anon_struct_in_union.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/anon_union.rs b/tests/expectations/tests/anon_union.rs
index fde9b307..5a12dccc 100644
--- a/tests/expectations/tests/anon_union.rs
+++ b/tests/expectations/tests/anon_union.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/anonymous-template-types.rs b/tests/expectations/tests/anonymous-template-types.rs
index 1dcd7e97..0f19d86e 100644
--- a/tests/expectations/tests/anonymous-template-types.rs
+++ b/tests/expectations/tests/anonymous-template-types.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/arg_keyword.rs b/tests/expectations/tests/arg_keyword.rs
index cb1cc432..8406eaab 100644
--- a/tests/expectations/tests/arg_keyword.rs
+++ b/tests/expectations/tests/arg_keyword.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs b/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs
index 9ff4af1f..3bd9bec0 100644
--- a/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs
+++ b/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/base-to-derived.rs b/tests/expectations/tests/base-to-derived.rs
index 6ff4ce9a..0a9e1c35 100644
--- a/tests/expectations/tests/base-to-derived.rs
+++ b/tests/expectations/tests/base-to-derived.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/bitfield-enum-basic.rs b/tests/expectations/tests/bitfield-enum-basic.rs
index e12574ad..ebb3fef4 100644
--- a/tests/expectations/tests/bitfield-enum-basic.rs
+++ b/tests/expectations/tests/bitfield-enum-basic.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const Foo_Bar: Foo = Foo(2);
diff --git a/tests/expectations/tests/bitfield-large.rs b/tests/expectations/tests/bitfield-large.rs
index d4fe9694..5606f64e 100644
--- a/tests/expectations/tests/bitfield-large.rs
+++ b/tests/expectations/tests/bitfield-large.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/bitfield-method-same-name.rs b/tests/expectations/tests/bitfield-method-same-name.rs
index 2ad9b8bb..f0ef0e31 100644
--- a/tests/expectations/tests/bitfield-method-same-name.rs
+++ b/tests/expectations/tests/bitfield-method-same-name.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/bitfield_align.rs b/tests/expectations/tests/bitfield_align.rs
index 08344342..7ebf1bbe 100644
--- a/tests/expectations/tests/bitfield_align.rs
+++ b/tests/expectations/tests/bitfield_align.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/bitfield_method_mangling.rs b/tests/expectations/tests/bitfield_method_mangling.rs
index 26f20081..314121a9 100644
--- a/tests/expectations/tests/bitfield_method_mangling.rs
+++ b/tests/expectations/tests/bitfield_method_mangling.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/blocks.rs b/tests/expectations/tests/blocks.rs
index 528ea518..40ee5c50 100644
--- a/tests/expectations/tests/blocks.rs
+++ b/tests/expectations/tests/blocks.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/builtin-template.rs b/tests/expectations/tests/builtin-template.rs
index 44cda83c..398c3c4a 100644
--- a/tests/expectations/tests/builtin-template.rs
+++ b/tests/expectations/tests/builtin-template.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type std_make_integer_sequence = u8;
diff --git a/tests/expectations/tests/c-empty-layout.rs b/tests/expectations/tests/c-empty-layout.rs
index 7dc16d48..c599b01b 100644
--- a/tests/expectations/tests/c-empty-layout.rs
+++ b/tests/expectations/tests/c-empty-layout.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/canonical_path_without_namespacing.rs b/tests/expectations/tests/canonical_path_without_namespacing.rs
index 43bec38d..d518a153 100644
--- a/tests/expectations/tests/canonical_path_without_namespacing.rs
+++ b/tests/expectations/tests/canonical_path_without_namespacing.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/char.rs b/tests/expectations/tests/char.rs
index 5541d492..be92e545 100644
--- a/tests/expectations/tests/char.rs
+++ b/tests/expectations/tests/char.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type Char = ::std::os::raw::c_char;
diff --git a/tests/expectations/tests/class.rs b/tests/expectations/tests/class.rs
index 56353a5e..43e67153 100644
--- a/tests/expectations/tests/class.rs
+++ b/tests/expectations/tests/class.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/class_nested.rs b/tests/expectations/tests/class_nested.rs
index ba1d274c..5ab0c918 100644
--- a/tests/expectations/tests/class_nested.rs
+++ b/tests/expectations/tests/class_nested.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/class_no_members.rs b/tests/expectations/tests/class_no_members.rs
index ad532100..41b97a9c 100644
--- a/tests/expectations/tests/class_no_members.rs
+++ b/tests/expectations/tests/class_no_members.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/class_static.rs b/tests/expectations/tests/class_static.rs
index 521621a7..b48fd052 100644
--- a/tests/expectations/tests/class_static.rs
+++ b/tests/expectations/tests/class_static.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/class_static_const.rs b/tests/expectations/tests/class_static_const.rs
index 4b0108a1..b8e91bd3 100644
--- a/tests/expectations/tests/class_static_const.rs
+++ b/tests/expectations/tests/class_static_const.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/class_use_as.rs b/tests/expectations/tests/class_use_as.rs
index f4db9013..61a78e21 100644
--- a/tests/expectations/tests/class_use_as.rs
+++ b/tests/expectations/tests/class_use_as.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/**
diff --git a/tests/expectations/tests/class_with_dtor.rs b/tests/expectations/tests/class_with_dtor.rs
index f7f8e20b..c3cd31f2 100644
--- a/tests/expectations/tests/class_with_dtor.rs
+++ b/tests/expectations/tests/class_with_dtor.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/class_with_inner_struct.rs b/tests/expectations/tests/class_with_inner_struct.rs
index a99aada5..f4b03b4e 100644
--- a/tests/expectations/tests/class_with_inner_struct.rs
+++ b/tests/expectations/tests/class_with_inner_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/class_with_typedef.rs b/tests/expectations/tests/class_with_typedef.rs
index 642a7287..9dba8675 100644
--- a/tests/expectations/tests/class_with_typedef.rs
+++ b/tests/expectations/tests/class_with_typedef.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type AnotherInt = ::std::os::raw::c_int;
diff --git a/tests/expectations/tests/complex.rs b/tests/expectations/tests/complex.rs
index d250f6b1..22eb92b8 100644
--- a/tests/expectations/tests/complex.rs
+++ b/tests/expectations/tests/complex.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
diff --git a/tests/expectations/tests/complex_global.rs b/tests/expectations/tests/complex_global.rs
index badc4d1f..83135220 100644
--- a/tests/expectations/tests/complex_global.rs
+++ b/tests/expectations/tests/complex_global.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
diff --git a/tests/expectations/tests/const_array_fn_arg.rs b/tests/expectations/tests/const_array_fn_arg.rs
index 623d28b2..5e934bcb 100644
--- a/tests/expectations/tests/const_array_fn_arg.rs
+++ b/tests/expectations/tests/const_array_fn_arg.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/const_enum_unnamed.rs b/tests/expectations/tests/const_enum_unnamed.rs
index b6f61b35..98c6240f 100644
--- a/tests/expectations/tests/const_enum_unnamed.rs
+++ b/tests/expectations/tests/const_enum_unnamed.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const FOO_BAR: _bindgen_ty_1 = _bindgen_ty_1::FOO_BAR;
diff --git a/tests/expectations/tests/const_ptr.rs b/tests/expectations/tests/const_ptr.rs
index 89400df1..9831cd8d 100644
--- a/tests/expectations/tests/const_ptr.rs
+++ b/tests/expectations/tests/const_ptr.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/const_resolved_ty.rs b/tests/expectations/tests/const_resolved_ty.rs
index 77d8f438..7c4b91b0 100644
--- a/tests/expectations/tests/const_resolved_ty.rs
+++ b/tests/expectations/tests/const_resolved_ty.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/const_tparam.rs b/tests/expectations/tests/const_tparam.rs
index 983958af..9c101ec6 100644
--- a/tests/expectations/tests/const_tparam.rs
+++ b/tests/expectations/tests/const_tparam.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/constant-non-specialized-tp.rs b/tests/expectations/tests/constant-non-specialized-tp.rs
index a17e261b..8be8e5d3 100644
--- a/tests/expectations/tests/constant-non-specialized-tp.rs
+++ b/tests/expectations/tests/constant-non-specialized-tp.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/constify-all-enums.rs b/tests/expectations/tests/constify-all-enums.rs
index e1210d9a..700ddeb4 100644
--- a/tests/expectations/tests/constify-all-enums.rs
+++ b/tests/expectations/tests/constify-all-enums.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const foo_THIS: foo = 0;
diff --git a/tests/expectations/tests/constify-enum.rs b/tests/expectations/tests/constify-enum.rs
index 989c5197..1d04210b 100644
--- a/tests/expectations/tests/constify-enum.rs
+++ b/tests/expectations/tests/constify-enum.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const nsCSSPropertyID_eCSSProperty_COUNT_unexistingVariantValue:
diff --git a/tests/expectations/tests/constructor-tp.rs b/tests/expectations/tests/constructor-tp.rs
index 6ba52f22..7ce4b9b3 100644
--- a/tests/expectations/tests/constructor-tp.rs
+++ b/tests/expectations/tests/constructor-tp.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/constructors.rs b/tests/expectations/tests/constructors.rs
index 13a4dcf8..c267ce1c 100644
--- a/tests/expectations/tests/constructors.rs
+++ b/tests/expectations/tests/constructors.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/convert-floats.rs b/tests/expectations/tests/convert-floats.rs
index ba35da33..906da262 100644
--- a/tests/expectations/tests/convert-floats.rs
+++ b/tests/expectations/tests/convert-floats.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
diff --git a/tests/expectations/tests/cpp-empty-layout.rs b/tests/expectations/tests/cpp-empty-layout.rs
index fbeb3d5e..c894b95c 100644
--- a/tests/expectations/tests/cpp-empty-layout.rs
+++ b/tests/expectations/tests/cpp-empty-layout.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/crtp.rs b/tests/expectations/tests/crtp.rs
index 8df5716e..03fef4cd 100644
--- a/tests/expectations/tests/crtp.rs
+++ b/tests/expectations/tests/crtp.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/dash_language.rs b/tests/expectations/tests/dash_language.rs
index 385c39c6..f6d15d1c 100644
--- a/tests/expectations/tests/dash_language.rs
+++ b/tests/expectations/tests/dash_language.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/decl_extern_int_twice.rs b/tests/expectations/tests/decl_extern_int_twice.rs
index 603a51b1..a7954390 100644
--- a/tests/expectations/tests/decl_extern_int_twice.rs
+++ b/tests/expectations/tests/decl_extern_int_twice.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/decl_ptr_to_array.rs b/tests/expectations/tests/decl_ptr_to_array.rs
index b8abedb5..4045a121 100644
--- a/tests/expectations/tests/decl_ptr_to_array.rs
+++ b/tests/expectations/tests/decl_ptr_to_array.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/default-template-parameter.rs b/tests/expectations/tests/default-template-parameter.rs
index a180dcf9..5781c7fb 100644
--- a/tests/expectations/tests/default-template-parameter.rs
+++ b/tests/expectations/tests/default-template-parameter.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/derive-fn-ptr.rs b/tests/expectations/tests/derive-fn-ptr.rs
index b6a4f351..1d9a480e 100644
--- a/tests/expectations/tests/derive-fn-ptr.rs
+++ b/tests/expectations/tests/derive-fn-ptr.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type my_fun_t =
diff --git a/tests/expectations/tests/disable-namespacing.rs b/tests/expectations/tests/disable-namespacing.rs
index 5c166946..b369a22d 100644
--- a/tests/expectations/tests/disable-namespacing.rs
+++ b/tests/expectations/tests/disable-namespacing.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type Baz = ::std::os::raw::c_int;
diff --git a/tests/expectations/tests/duplicated-namespaces-definitions.rs b/tests/expectations/tests/duplicated-namespaces-definitions.rs
index faba454d..67ca77d6 100644
--- a/tests/expectations/tests/duplicated-namespaces-definitions.rs
+++ b/tests/expectations/tests/duplicated-namespaces-definitions.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/duplicated-namespaces.rs b/tests/expectations/tests/duplicated-namespaces.rs
index 7416dad9..a5f2caac 100644
--- a/tests/expectations/tests/duplicated-namespaces.rs
+++ b/tests/expectations/tests/duplicated-namespaces.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/duplicated_constants_in_ns.rs b/tests/expectations/tests/duplicated_constants_in_ns.rs
index 226765b6..c3f1adde 100644
--- a/tests/expectations/tests/duplicated_constants_in_ns.rs
+++ b/tests/expectations/tests/duplicated_constants_in_ns.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/elaborated.rs b/tests/expectations/tests/elaborated.rs
index 0e8f4ee5..fbbef1cf 100644
--- a/tests/expectations/tests/elaborated.rs
+++ b/tests/expectations/tests/elaborated.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type whatever_whatever_t = ::std::os::raw::c_int;
diff --git a/tests/expectations/tests/empty_template_param_name.rs b/tests/expectations/tests/empty_template_param_name.rs
index 2bd5a570..f182d9c2 100644
--- a/tests/expectations/tests/empty_template_param_name.rs
+++ b/tests/expectations/tests/empty_template_param_name.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type __void_t = ::std::os::raw::c_void;
diff --git a/tests/expectations/tests/enum.rs b/tests/expectations/tests/enum.rs
index 8138d697..9eafbbd2 100644
--- a/tests/expectations/tests/enum.rs
+++ b/tests/expectations/tests/enum.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(u32)]
diff --git a/tests/expectations/tests/enum_alias.rs b/tests/expectations/tests/enum_alias.rs
index 7ea85598..c77bf11d 100644
--- a/tests/expectations/tests/enum_alias.rs
+++ b/tests/expectations/tests/enum_alias.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(u8)]
diff --git a/tests/expectations/tests/enum_and_vtable_mangling.rs b/tests/expectations/tests/enum_and_vtable_mangling.rs
index b34e217f..2b58a6b2 100644
--- a/tests/expectations/tests/enum_and_vtable_mangling.rs
+++ b/tests/expectations/tests/enum_and_vtable_mangling.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const match_: _bindgen_ty_1 = _bindgen_ty_1::match_;
diff --git a/tests/expectations/tests/enum_dupe.rs b/tests/expectations/tests/enum_dupe.rs
index 322b89fc..5b6102c9 100644
--- a/tests/expectations/tests/enum_dupe.rs
+++ b/tests/expectations/tests/enum_dupe.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const Foo_Dupe: Foo = Foo::Bar;
diff --git a/tests/expectations/tests/enum_explicit_type.rs b/tests/expectations/tests/enum_explicit_type.rs
index 4e555d3a..73fc23f5 100644
--- a/tests/expectations/tests/enum_explicit_type.rs
+++ b/tests/expectations/tests/enum_explicit_type.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(u8)]
diff --git a/tests/expectations/tests/enum_in_template_with_typedef.rs b/tests/expectations/tests/enum_in_template_with_typedef.rs
index 2b956963..8c819535 100644
--- a/tests/expectations/tests/enum_in_template_with_typedef.rs
+++ b/tests/expectations/tests/enum_in_template_with_typedef.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/enum_negative.rs b/tests/expectations/tests/enum_negative.rs
index 74cf4f16..b47fdf09 100644
--- a/tests/expectations/tests/enum_negative.rs
+++ b/tests/expectations/tests/enum_negative.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(i32)]
diff --git a/tests/expectations/tests/enum_packed.rs b/tests/expectations/tests/enum_packed.rs
index 963763e1..75b68ee1 100644
--- a/tests/expectations/tests/enum_packed.rs
+++ b/tests/expectations/tests/enum_packed.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(u8)]
diff --git a/tests/expectations/tests/eval-variadic-template-parameter.rs b/tests/expectations/tests/eval-variadic-template-parameter.rs
index 701aab9f..1386396f 100644
--- a/tests/expectations/tests/eval-variadic-template-parameter.rs
+++ b/tests/expectations/tests/eval-variadic-template-parameter.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/extern.rs b/tests/expectations/tests/extern.rs
index e7ac7504..789ed438 100644
--- a/tests/expectations/tests/extern.rs
+++ b/tests/expectations/tests/extern.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type foo =
diff --git a/tests/expectations/tests/float128.rs b/tests/expectations/tests/float128.rs
index b4b7b2bc..2ca90d40 100644
--- a/tests/expectations/tests/float128.rs
+++ b/tests/expectations/tests/float128.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/forward-declaration-autoptr.rs b/tests/expectations/tests/forward-declaration-autoptr.rs
index 08ee31ef..3d2708d5 100644
--- a/tests/expectations/tests/forward-declaration-autoptr.rs
+++ b/tests/expectations/tests/forward-declaration-autoptr.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/forward-enum-decl.rs b/tests/expectations/tests/forward-enum-decl.rs
index 7f2d937a..8b705f2a 100644
--- a/tests/expectations/tests/forward-enum-decl.rs
+++ b/tests/expectations/tests/forward-enum-decl.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(i32)]
diff --git a/tests/expectations/tests/forward-inherit-struct-with-fields.rs b/tests/expectations/tests/forward-inherit-struct-with-fields.rs
index 77a43405..2705ad0f 100644
--- a/tests/expectations/tests/forward-inherit-struct-with-fields.rs
+++ b/tests/expectations/tests/forward-inherit-struct-with-fields.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/forward-inherit-struct.rs b/tests/expectations/tests/forward-inherit-struct.rs
index 322854dd..28d8928b 100644
--- a/tests/expectations/tests/forward-inherit-struct.rs
+++ b/tests/expectations/tests/forward-inherit-struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/forward_declared_complex_types.rs b/tests/expectations/tests/forward_declared_complex_types.rs
index 03330b2f..9baa2d8d 100644
--- a/tests/expectations/tests/forward_declared_complex_types.rs
+++ b/tests/expectations/tests/forward_declared_complex_types.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/forward_declared_struct.rs b/tests/expectations/tests/forward_declared_struct.rs
index ec8b15d1..a0f0c137 100644
--- a/tests/expectations/tests/forward_declared_struct.rs
+++ b/tests/expectations/tests/forward_declared_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/func_proto.rs b/tests/expectations/tests/func_proto.rs
index e7ac7504..789ed438 100644
--- a/tests/expectations/tests/func_proto.rs
+++ b/tests/expectations/tests/func_proto.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type foo =
diff --git a/tests/expectations/tests/func_ptr.rs b/tests/expectations/tests/func_ptr.rs
index 87ec3e3d..fb3860a4 100644
--- a/tests/expectations/tests/func_ptr.rs
+++ b/tests/expectations/tests/func_ptr.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/func_ptr_in_struct.rs b/tests/expectations/tests/func_ptr_in_struct.rs
index ce145866..f52c56ba 100644
--- a/tests/expectations/tests/func_ptr_in_struct.rs
+++ b/tests/expectations/tests/func_ptr_in_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
diff --git a/tests/expectations/tests/func_with_array_arg.rs b/tests/expectations/tests/func_with_array_arg.rs
index 1528e0ba..ec5617dc 100644
--- a/tests/expectations/tests/func_with_array_arg.rs
+++ b/tests/expectations/tests/func_with_array_arg.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/func_with_func_ptr_arg.rs b/tests/expectations/tests/func_with_func_ptr_arg.rs
index 4ac25286..fed557b8 100644
--- a/tests/expectations/tests/func_with_func_ptr_arg.rs
+++ b/tests/expectations/tests/func_with_func_ptr_arg.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/gen-constructors-neg.rs b/tests/expectations/tests/gen-constructors-neg.rs
index fbeb3d5e..c894b95c 100644
--- a/tests/expectations/tests/gen-constructors-neg.rs
+++ b/tests/expectations/tests/gen-constructors-neg.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/gen-constructors.rs b/tests/expectations/tests/gen-constructors.rs
index 72c2fc53..d0439864 100644
--- a/tests/expectations/tests/gen-constructors.rs
+++ b/tests/expectations/tests/gen-constructors.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/gen-destructors-neg.rs b/tests/expectations/tests/gen-destructors-neg.rs
index 4aaec83a..64373d75 100644
--- a/tests/expectations/tests/gen-destructors-neg.rs
+++ b/tests/expectations/tests/gen-destructors-neg.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/gen-destructors.rs b/tests/expectations/tests/gen-destructors.rs
index 7ec13b03..711d6f23 100644
--- a/tests/expectations/tests/gen-destructors.rs
+++ b/tests/expectations/tests/gen-destructors.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/generate-inline.rs b/tests/expectations/tests/generate-inline.rs
index 72057414..15f944d3 100644
--- a/tests/expectations/tests/generate-inline.rs
+++ b/tests/expectations/tests/generate-inline.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/in_class_typedef.rs b/tests/expectations/tests/in_class_typedef.rs
index 613c8cab..92a23ad3 100644
--- a/tests/expectations/tests/in_class_typedef.rs
+++ b/tests/expectations/tests/in_class_typedef.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/infinite-macro.rs b/tests/expectations/tests/infinite-macro.rs
index 4f74bf90..7c88ce2a 100644
--- a/tests/expectations/tests/infinite-macro.rs
+++ b/tests/expectations/tests/infinite-macro.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const INFINITY: f64 = ::std::f64::INFINITY;
diff --git a/tests/expectations/tests/inherit-namespaced.rs b/tests/expectations/tests/inherit-namespaced.rs
index fcd8de97..e3f2b225 100644
--- a/tests/expectations/tests/inherit-namespaced.rs
+++ b/tests/expectations/tests/inherit-namespaced.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/inherit_named.rs b/tests/expectations/tests/inherit_named.rs
index 4951a1c6..0503804a 100644
--- a/tests/expectations/tests/inherit_named.rs
+++ b/tests/expectations/tests/inherit_named.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/inherit_typedef.rs b/tests/expectations/tests/inherit_typedef.rs
index 76d7c35f..85af3e03 100644
--- a/tests/expectations/tests/inherit_typedef.rs
+++ b/tests/expectations/tests/inherit_typedef.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/inline-function.rs b/tests/expectations/tests/inline-function.rs
index b4b7b2bc..2ca90d40 100644
--- a/tests/expectations/tests/inline-function.rs
+++ b/tests/expectations/tests/inline-function.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/inline_namespace.rs b/tests/expectations/tests/inline_namespace.rs
index d62fb862..13f3b8ee 100644
--- a/tests/expectations/tests/inline_namespace.rs
+++ b/tests/expectations/tests/inline_namespace.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/inline_namespace_conservative.rs b/tests/expectations/tests/inline_namespace_conservative.rs
index 267f28cf..406d9f5e 100644
--- a/tests/expectations/tests/inline_namespace_conservative.rs
+++ b/tests/expectations/tests/inline_namespace_conservative.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/inline_namespace_whitelist.rs b/tests/expectations/tests/inline_namespace_whitelist.rs
index 96012684..857a7005 100644
--- a/tests/expectations/tests/inline_namespace_whitelist.rs
+++ b/tests/expectations/tests/inline_namespace_whitelist.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/inner_const.rs b/tests/expectations/tests/inner_const.rs
index fd2793a4..dd92dac9 100644
--- a/tests/expectations/tests/inner_const.rs
+++ b/tests/expectations/tests/inner_const.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/inner_template_self.rs b/tests/expectations/tests/inner_template_self.rs
index d75c280d..e1a5302f 100644
--- a/tests/expectations/tests/inner_template_self.rs
+++ b/tests/expectations/tests/inner_template_self.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/int128_t.rs b/tests/expectations/tests/int128_t.rs
index b4b7b2bc..2ca90d40 100644
--- a/tests/expectations/tests/int128_t.rs
+++ b/tests/expectations/tests/int128_t.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-358.rs b/tests/expectations/tests/issue-358.rs
index d01ae800..c094b333 100644
--- a/tests/expectations/tests/issue-358.rs
+++ b/tests/expectations/tests/issue-358.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-372.rs b/tests/expectations/tests/issue-372.rs
index 3f4592f3..8a115924 100644
--- a/tests/expectations/tests/issue-372.rs
+++ b/tests/expectations/tests/issue-372.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-410.rs b/tests/expectations/tests/issue-410.rs
index 8833ef4e..9f0b9a14 100644
--- a/tests/expectations/tests/issue-410.rs
+++ b/tests/expectations/tests/issue-410.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-446.rs b/tests/expectations/tests/issue-446.rs
index 13204c1a..d416548d 100644
--- a/tests/expectations/tests/issue-446.rs
+++ b/tests/expectations/tests/issue-446.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-447.rs b/tests/expectations/tests/issue-447.rs
index 619a17b8..4a7f07ed 100644
--- a/tests/expectations/tests/issue-447.rs
+++ b/tests/expectations/tests/issue-447.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-493.rs b/tests/expectations/tests/issue-493.rs
index 04fa1d8c..89f03457 100644
--- a/tests/expectations/tests/issue-493.rs
+++ b/tests/expectations/tests/issue-493.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-544-stylo-creduce-2.rs b/tests/expectations/tests/issue-544-stylo-creduce-2.rs
index c0fae845..e217fe24 100644
--- a/tests/expectations/tests/issue-544-stylo-creduce-2.rs
+++ b/tests/expectations/tests/issue-544-stylo-creduce-2.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-544-stylo-creduce.rs b/tests/expectations/tests/issue-544-stylo-creduce.rs
index fb543cba..fbee3b25 100644
--- a/tests/expectations/tests/issue-544-stylo-creduce.rs
+++ b/tests/expectations/tests/issue-544-stylo-creduce.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs b/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs
index 48e86596..11d60e04 100644
--- a/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs
+++ b/tests/expectations/tests/issue-569-non-type-template-params-causing-layout-test-failures.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const ENUM_VARIANT_1: _bindgen_ty_1 = _bindgen_ty_1::ENUM_VARIANT_1;
diff --git a/tests/expectations/tests/issue-573-layout-test-failures.rs b/tests/expectations/tests/issue-573-layout-test-failures.rs
index dc582c1b..f82b902d 100644
--- a/tests/expectations/tests/issue-573-layout-test-failures.rs
+++ b/tests/expectations/tests/issue-573-layout-test-failures.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs
index 084cdb62..610c0c83 100644
--- a/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs
+++ b/tests/expectations/tests/issue-574-assertion-failure-in-codegen.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs
index b1af2b8c..b7fa68a3 100644
--- a/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs
+++ b/tests/expectations/tests/issue-584-stylo-template-analysis-panic.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type RefPtr<T> = T;
diff --git a/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs b/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs
index 0b28a558..4bda0927 100644
--- a/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs
+++ b/tests/expectations/tests/issue-638-stylo-cannot-find-T-in-this-scope.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-639-typedef-anon-field.rs b/tests/expectations/tests/issue-639-typedef-anon-field.rs
index 8d5709f4..e67400cc 100644
--- a/tests/expectations/tests/issue-639-typedef-anon-field.rs
+++ b/tests/expectations/tests/issue-639-typedef-anon-field.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-643-inner-struct.rs b/tests/expectations/tests/issue-643-inner-struct.rs
index 5069905b..a2225003 100644
--- a/tests/expectations/tests/issue-643-inner-struct.rs
+++ b/tests/expectations/tests/issue-643-inner-struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs b/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs
index 68c07647..d705ffa3 100644
--- a/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs
+++ b/tests/expectations/tests/issue-645-cannot-find-type-T-in-this-scope.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T);
diff --git a/tests/expectations/tests/issue-654-struct-fn-collision.rs b/tests/expectations/tests/issue-654-struct-fn-collision.rs
index c2915b3f..8b2bb533 100644
--- a/tests/expectations/tests/issue-654-struct-fn-collision.rs
+++ b/tests/expectations/tests/issue-654-struct-fn-collision.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs b/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs
index 7ee918a3..3e7c4195 100644
--- a/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs
+++ b/tests/expectations/tests/issue-662-cannot-find-T-in-this-scope.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue-662-part-2.rs b/tests/expectations/tests/issue-662-part-2.rs
index 52a9cafc..8225cf18 100644
--- a/tests/expectations/tests/issue-662-part-2.rs
+++ b/tests/expectations/tests/issue-662-part-2.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[derive(Clone, Copy, Debug)] pub struct RefPtr<T>(T);
diff --git a/tests/expectations/tests/issue-674-1.rs b/tests/expectations/tests/issue-674-1.rs
index 8be8721c..01257c23 100644
--- a/tests/expectations/tests/issue-674-1.rs
+++ b/tests/expectations/tests/issue-674-1.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-674-2.rs b/tests/expectations/tests/issue-674-2.rs
index 1f597c9e..819eff05 100644
--- a/tests/expectations/tests/issue-674-2.rs
+++ b/tests/expectations/tests/issue-674-2.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-674-3.rs b/tests/expectations/tests/issue-674-3.rs
index 69587deb..6e915a18 100644
--- a/tests/expectations/tests/issue-674-3.rs
+++ b/tests/expectations/tests/issue-674-3.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-677-nested-ns-specifier.rs b/tests/expectations/tests/issue-677-nested-ns-specifier.rs
index 44d9904a..c3fb0406 100644
--- a/tests/expectations/tests/issue-677-nested-ns-specifier.rs
+++ b/tests/expectations/tests/issue-677-nested-ns-specifier.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue-691-template-parameter-virtual.rs b/tests/expectations/tests/issue-691-template-parameter-virtual.rs
index 4903fbfd..b0bcb541 100644
--- a/tests/expectations/tests/issue-691-template-parameter-virtual.rs
+++ b/tests/expectations/tests/issue-691-template-parameter-virtual.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/issue_311.rs b/tests/expectations/tests/issue_311.rs
index 0510f1c1..c5ecb966 100644
--- a/tests/expectations/tests/issue_311.rs
+++ b/tests/expectations/tests/issue_311.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/issue_315.rs b/tests/expectations/tests/issue_315.rs
index a5ab63fc..d5302451 100644
--- a/tests/expectations/tests/issue_315.rs
+++ b/tests/expectations/tests/issue_315.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/// <div rustbindgen replaces="c"></div>
diff --git a/tests/expectations/tests/jsval_layout_opaque.rs b/tests/expectations/tests/jsval_layout_opaque.rs
index d1e94081..4010b0d8 100644
--- a/tests/expectations/tests/jsval_layout_opaque.rs
+++ b/tests/expectations/tests/jsval_layout_opaque.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/keywords.rs b/tests/expectations/tests/keywords.rs
index 5b75389e..037a8d80 100644
--- a/tests/expectations/tests/keywords.rs
+++ b/tests/expectations/tests/keywords.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/layout.rs b/tests/expectations/tests/layout.rs
index 115a108a..c3673cb1 100644
--- a/tests/expectations/tests/layout.rs
+++ b/tests/expectations/tests/layout.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/layout_align.rs b/tests/expectations/tests/layout_align.rs
index 2202b9d0..efcb9753 100644
--- a/tests/expectations/tests/layout_align.rs
+++ b/tests/expectations/tests/layout_align.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/layout_arp.rs b/tests/expectations/tests/layout_arp.rs
index f3c59eb4..03f4b440 100644
--- a/tests/expectations/tests/layout_arp.rs
+++ b/tests/expectations/tests/layout_arp.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const ETHER_ADDR_LEN: ::std::os::raw::c_uint = 6;
diff --git a/tests/expectations/tests/layout_array.rs b/tests/expectations/tests/layout_array.rs
index 0f9944e8..3ca0ffe8 100644
--- a/tests/expectations/tests/layout_array.rs
+++ b/tests/expectations/tests/layout_array.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
diff --git a/tests/expectations/tests/layout_array_too_long.rs b/tests/expectations/tests/layout_array_too_long.rs
index c395f08d..2dae536a 100644
--- a/tests/expectations/tests/layout_array_too_long.rs
+++ b/tests/expectations/tests/layout_array_too_long.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
diff --git a/tests/expectations/tests/layout_cmdline_token.rs b/tests/expectations/tests/layout_cmdline_token.rs
index 791ea9b3..a6113a34 100644
--- a/tests/expectations/tests/layout_cmdline_token.rs
+++ b/tests/expectations/tests/layout_cmdline_token.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/**
diff --git a/tests/expectations/tests/layout_eth_conf.rs b/tests/expectations/tests/layout_eth_conf.rs
index 3f79d7b0..17ce893b 100644
--- a/tests/expectations/tests/layout_eth_conf.rs
+++ b/tests/expectations/tests/layout_eth_conf.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/layout_kni_mbuf.rs b/tests/expectations/tests/layout_kni_mbuf.rs
index d704267d..556afcc2 100644
--- a/tests/expectations/tests/layout_kni_mbuf.rs
+++ b/tests/expectations/tests/layout_kni_mbuf.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const RTE_CACHE_LINE_MIN_SIZE: ::std::os::raw::c_uint = 64;
diff --git a/tests/expectations/tests/layout_large_align_field.rs b/tests/expectations/tests/layout_large_align_field.rs
index 820e4210..09868689 100644
--- a/tests/expectations/tests/layout_large_align_field.rs
+++ b/tests/expectations/tests/layout_large_align_field.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/layout_mbuf.rs b/tests/expectations/tests/layout_mbuf.rs
index f4b3dc26..e0e95a1f 100644
--- a/tests/expectations/tests/layout_mbuf.rs
+++ b/tests/expectations/tests/layout_mbuf.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/libclang-3.8/auto.rs b/tests/expectations/tests/libclang-3.8/auto.rs
new file mode 100644
index 00000000..cf7320f5
--- /dev/null
+++ b/tests/expectations/tests/libclang-3.8/auto.rs
@@ -0,0 +1,34 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Foo {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_ZN3Foo4kFooE"]
+ pub static Foo_kFoo: bool;
+}
+#[test]
+fn bindgen_test_layout_Foo() {
+ assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Foo ) ));
+ assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Foo ) ));
+}
+impl Clone for Foo {
+ fn clone(&self) -> Self { *self }
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct Bar {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_Z5Test2v"]
+ pub fn Test2() -> ::std::os::raw::c_uint;
+}
diff --git a/tests/expectations/tests/libclang-3.8/call-conv-field.rs b/tests/expectations/tests/libclang-3.8/call-conv-field.rs
new file mode 100644
index 00000000..31fb309c
--- /dev/null
+++ b/tests/expectations/tests/libclang-3.8/call-conv-field.rs
@@ -0,0 +1,42 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Copy)]
+pub struct JNINativeInterface_ {
+ pub GetVersion: ::std::option::Option<unsafe extern "stdcall" fn(env:
+ *mut ::std::os::raw::c_void)
+ -> ::std::os::raw::c_int>,
+ pub __hack: ::std::os::raw::c_ulonglong,
+}
+#[test]
+fn bindgen_test_layout_JNINativeInterface_() {
+ assert_eq!(::std::mem::size_of::<JNINativeInterface_>() , 16usize , concat
+ ! ( "Size of: " , stringify ! ( JNINativeInterface_ ) ));
+ assert_eq! (::std::mem::align_of::<JNINativeInterface_>() , 8usize ,
+ concat ! (
+ "Alignment of " , stringify ! ( JNINativeInterface_ ) ));
+ assert_eq! (unsafe {
+ & ( * ( 0 as * const JNINativeInterface_ ) ) . GetVersion as *
+ const _ as usize } , 0usize , concat ! (
+ "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
+ "::" , stringify ! ( GetVersion ) ));
+ assert_eq! (unsafe {
+ & ( * ( 0 as * const JNINativeInterface_ ) ) . __hack as *
+ const _ as usize } , 8usize , concat ! (
+ "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
+ "::" , stringify ! ( __hack ) ));
+}
+impl Clone for JNINativeInterface_ {
+ fn clone(&self) -> Self { *self }
+}
+impl Default for JNINativeInterface_ {
+ fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+}
+extern "C" {
+ #[link_name = "_bar@0"]
+ pub fn bar();
+}
diff --git a/tests/expectations/tests/libclang-3.8/const_bool.rs b/tests/expectations/tests/libclang-3.8/const_bool.rs
new file mode 100644
index 00000000..cc150436
--- /dev/null
+++ b/tests/expectations/tests/libclang-3.8/const_bool.rs
@@ -0,0 +1,34 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+extern "C" {
+ #[link_name = "_ZL1k"]
+ pub static k: bool;
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct A {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_ZN1A1kE"]
+ pub static A_k: bool;
+}
+#[test]
+fn bindgen_test_layout_A() {
+ assert_eq!(::std::mem::size_of::<A>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( A ) ));
+ assert_eq! (::std::mem::align_of::<A>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( A ) ));
+}
+impl Clone for A {
+ fn clone(&self) -> Self { *self }
+}
+pub type foo = bool;
+extern "C" {
+ #[link_name = "_ZL2k2"]
+ pub static k2: foo;
+}
diff --git a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs
new file mode 100644
index 00000000..9089b442
--- /dev/null
+++ b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs
@@ -0,0 +1,41 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
+pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub enum _bindgen_ty_1 { foo = 4, bar = 8, }
+pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
+pub const k: EasyToOverflow = 2147483648;
+extern "C" {
+ #[link_name = "k_expr"]
+ pub static k_expr: EasyToOverflow;
+}
+extern "C" {
+ #[link_name = "BAZ"]
+ pub static BAZ: ::std::os::raw::c_longlong;
+}
+extern "C" {
+ #[link_name = "fuzz"]
+ pub static fuzz: f64;
+}
+extern "C" {
+ #[link_name = "BAZZ"]
+ pub static BAZZ: ::std::os::raw::c_char;
+}
+extern "C" {
+ #[link_name = "WAT"]
+ pub static WAT: ::std::os::raw::c_char;
+}
+extern "C" {
+ #[link_name = "bytestring"]
+ pub static mut bytestring: *const ::std::os::raw::c_char;
+}
+extern "C" {
+ #[link_name = "NOT_UTF8"]
+ pub static mut NOT_UTF8: *const ::std::os::raw::c_char;
+}
diff --git a/tests/expectations/tests/objc_template.rs b/tests/expectations/tests/libclang-3.8/objc_template.rs
index e5a874c6..16efa59e 100644
--- a/tests/expectations/tests/objc_template.rs
+++ b/tests/expectations/tests/libclang-3.8/objc_template.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
new file mode 100644
index 00000000..e7e9572f
--- /dev/null
+++ b/tests/expectations/tests/libclang-3.8/partial-specialization-and-inheritance.rs
@@ -0,0 +1,56 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct Base {
+ pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct Derived {
+ pub b: bool,
+}
+#[test]
+fn __bindgen_test_layout__bindgen_ty_id_21_instantiation_1() {
+ assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! (
+ "Size of template specialization: " , stringify ! (
+ [u32; 2usize] ) ));
+ assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! (
+ "Alignment of template specialization: " , stringify ! (
+ [u32; 2usize] ) ));
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Usage {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_ZN5Usage13static_memberE"]
+ pub static mut Usage_static_member: [u32; 2usize];
+}
+#[test]
+fn bindgen_test_layout_Usage() {
+ assert_eq!(::std::mem::size_of::<Usage>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Usage ) ));
+ assert_eq! (::std::mem::align_of::<Usage>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Usage ) ));
+}
+extern "C" {
+ #[link_name = "_ZN5UsageC1Ev"]
+ pub fn Usage_Usage(this: *mut Usage);
+}
+impl Clone for Usage {
+ fn clone(&self) -> Self { *self }
+}
+impl Usage {
+ #[inline]
+ pub unsafe fn new() -> Self {
+ let mut __bindgen_tmp = ::std::mem::uninitialized();
+ Usage_Usage(&mut __bindgen_tmp);
+ __bindgen_tmp
+ }
+}
diff --git a/tests/expectations/tests/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs
index 20665af6..7728ddeb 100644
--- a/tests/expectations/tests/type_alias_template_specialized.rs
+++ b/tests/expectations/tests/libclang-3.8/type_alias_template_specialized.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/auto.rs b/tests/expectations/tests/libclang-3.9/auto.rs
index 7f9bbf44..70743067 100644
--- a/tests/expectations/tests/auto.rs
+++ b/tests/expectations/tests/libclang-3.9/auto.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/call-conv-field.rs b/tests/expectations/tests/libclang-3.9/call-conv-field.rs
index d6aa9e4e..39943119 100644
--- a/tests/expectations/tests/call-conv-field.rs
+++ b/tests/expectations/tests/libclang-3.9/call-conv-field.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/const_bool.rs b/tests/expectations/tests/libclang-3.9/const_bool.rs
index de9e81b0..fd0273aa 100644
--- a/tests/expectations/tests/const_bool.rs
+++ b/tests/expectations/tests/libclang-3.9/const_bool.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const k: bool = true;
diff --git a/tests/expectations/tests/constant-evaluate.rs b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs
index cdf097a2..ffa3fff8 100644
--- a/tests/expectations/tests/constant-evaluate.rs
+++ b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
diff --git a/tests/expectations/tests/libclang-3.9/objc_template.rs b/tests/expectations/tests/libclang-3.9/objc_template.rs
new file mode 100644
index 00000000..16efa59e
--- /dev/null
+++ b/tests/expectations/tests/libclang-3.9/objc_template.rs
@@ -0,0 +1,18 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+#![cfg(target_os="macos")]
+
+#[macro_use]
+extern crate objc;
+#[allow(non_camel_case_types)]
+pub type id = *mut objc::runtime::Object;
+pub trait Foo {
+ unsafe fn get(self)
+ -> id;
+}
+impl Foo for id {
+ unsafe fn get(self) -> id { msg_send!(self , get) }
+}
diff --git a/tests/expectations/tests/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
index 5e09ed4d..ec399304 100644
--- a/tests/expectations/tests/partial-specialization-and-inheritance.rs
+++ b/tests/expectations/tests/libclang-3.9/partial-specialization-and-inheritance.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs
new file mode 100644
index 00000000..7728ddeb
--- /dev/null
+++ b/tests/expectations/tests/libclang-3.9/type_alias_template_specialized.rs
@@ -0,0 +1,28 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Rooted {
+ pub ptr: ::std::os::raw::c_int,
+}
+#[test]
+fn bindgen_test_layout_Rooted() {
+ assert_eq!(::std::mem::size_of::<Rooted>() , 4usize , concat ! (
+ "Size of: " , stringify ! ( Rooted ) ));
+ assert_eq! (::std::mem::align_of::<Rooted>() , 4usize , concat ! (
+ "Alignment of " , stringify ! ( Rooted ) ));
+ assert_eq! (unsafe {
+ & ( * ( 0 as * const Rooted ) ) . ptr as * const _ as usize }
+ , 0usize , concat ! (
+ "Alignment of field: " , stringify ! ( Rooted ) , "::" ,
+ stringify ! ( ptr ) ));
+}
+impl Clone for Rooted {
+ fn clone(&self) -> Self { *self }
+}
+/// <div rustbindgen replaces="MaybeWrapped"></div>
+pub type MaybeWrapped<a> = a;
diff --git a/tests/expectations/tests/libclang-4/auto.rs b/tests/expectations/tests/libclang-4/auto.rs
new file mode 100644
index 00000000..70743067
--- /dev/null
+++ b/tests/expectations/tests/libclang-4/auto.rs
@@ -0,0 +1,31 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Foo {
+ pub _address: u8,
+}
+pub const Foo_kFoo: bool = true;
+#[test]
+fn bindgen_test_layout_Foo() {
+ assert_eq!(::std::mem::size_of::<Foo>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Foo ) ));
+ assert_eq! (::std::mem::align_of::<Foo>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Foo ) ));
+}
+impl Clone for Foo {
+ fn clone(&self) -> Self { *self }
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct Bar {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_Z5Test2v"]
+ pub fn Test2() -> ::std::os::raw::c_uint;
+}
diff --git a/tests/expectations/tests/libclang-4/call-conv-field.rs b/tests/expectations/tests/libclang-4/call-conv-field.rs
new file mode 100644
index 00000000..39943119
--- /dev/null
+++ b/tests/expectations/tests/libclang-4/call-conv-field.rs
@@ -0,0 +1,42 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Copy)]
+pub struct JNINativeInterface_ {
+ pub GetVersion: ::std::option::Option<unsafe extern "stdcall" fn(env:
+ *mut ::std::os::raw::c_void)
+ -> ::std::os::raw::c_int>,
+ pub __hack: ::std::os::raw::c_ulonglong,
+}
+#[test]
+fn bindgen_test_layout_JNINativeInterface_() {
+ assert_eq!(::std::mem::size_of::<JNINativeInterface_>() , 16usize , concat
+ ! ( "Size of: " , stringify ! ( JNINativeInterface_ ) ));
+ assert_eq! (::std::mem::align_of::<JNINativeInterface_>() , 8usize ,
+ concat ! (
+ "Alignment of " , stringify ! ( JNINativeInterface_ ) ));
+ assert_eq! (unsafe {
+ & ( * ( 0 as * const JNINativeInterface_ ) ) . GetVersion as *
+ const _ as usize } , 0usize , concat ! (
+ "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
+ "::" , stringify ! ( GetVersion ) ));
+ assert_eq! (unsafe {
+ & ( * ( 0 as * const JNINativeInterface_ ) ) . __hack as *
+ const _ as usize } , 8usize , concat ! (
+ "Alignment of field: " , stringify ! ( JNINativeInterface_ ) ,
+ "::" , stringify ! ( __hack ) ));
+}
+impl Clone for JNINativeInterface_ {
+ fn clone(&self) -> Self { *self }
+}
+impl Default for JNINativeInterface_ {
+ fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+}
+extern "stdcall" {
+ #[link_name = "_bar@0"]
+ pub fn bar();
+}
diff --git a/tests/expectations/tests/libclang-4/const_bool.rs b/tests/expectations/tests/libclang-4/const_bool.rs
new file mode 100644
index 00000000..fd0273aa
--- /dev/null
+++ b/tests/expectations/tests/libclang-4/const_bool.rs
@@ -0,0 +1,25 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+pub const k: bool = true;
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct A {
+ pub _address: u8,
+}
+pub const A_k: bool = false;
+#[test]
+fn bindgen_test_layout_A() {
+ assert_eq!(::std::mem::size_of::<A>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( A ) ));
+ assert_eq! (::std::mem::align_of::<A>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( A ) ));
+}
+impl Clone for A {
+ fn clone(&self) -> Self { *self }
+}
+pub type foo = bool;
+pub const k2: foo = true;
diff --git a/tests/expectations/tests/libclang-4/constant-evaluate.rs b/tests/expectations/tests/libclang-4/constant-evaluate.rs
new file mode 100644
index 00000000..ffa3fff8
--- /dev/null
+++ b/tests/expectations/tests/libclang-4/constant-evaluate.rs
@@ -0,0 +1,20 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
+pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
+#[repr(u32)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+pub enum _bindgen_ty_1 { foo = 4, bar = 8, }
+pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
+pub const k: EasyToOverflow = 2147483648;
+pub const k_expr: EasyToOverflow = 0;
+pub const BAZ: ::std::os::raw::c_longlong = 24;
+pub const fuzz: f64 = 51.;
+pub const BAZZ: ::std::os::raw::c_char = 53;
+pub const WAT: ::std::os::raw::c_char = 0;
+pub const bytestring: &'static [u8; 4usize] = b"Foo\x00";
+pub const NOT_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0];
diff --git a/tests/expectations/tests/libclang-4/objc_template.rs b/tests/expectations/tests/libclang-4/objc_template.rs
new file mode 100644
index 00000000..06a9a55f
--- /dev/null
+++ b/tests/expectations/tests/libclang-4/objc_template.rs
@@ -0,0 +1,18 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+#![cfg(target_os="macos")]
+
+#[macro_use]
+extern crate objc;
+#[allow(non_camel_case_types)]
+pub type id = *mut objc::runtime::Object;
+pub trait Foo {
+ unsafe fn get(self)
+ -> *mut ObjectType;
+}
+impl Foo for id {
+ unsafe fn get(self) -> *mut ObjectType { msg_send!(self , get) }
+}
diff --git a/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs b/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs
new file mode 100644
index 00000000..ec399304
--- /dev/null
+++ b/tests/expectations/tests/libclang-4/partial-specialization-and-inheritance.rs
@@ -0,0 +1,44 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct Base {
+ pub _address: u8,
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy, Clone)]
+pub struct Derived {
+ pub b: bool,
+}
+#[test]
+fn __bindgen_test_layout__bindgen_ty_id_20_instantiation_1() {
+ assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat ! (
+ "Size of template specialization: " , stringify ! (
+ [u32; 2usize] ) ));
+ assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat ! (
+ "Alignment of template specialization: " , stringify ! (
+ [u32; 2usize] ) ));
+}
+#[repr(C)]
+#[derive(Debug, Default, Copy)]
+pub struct Usage {
+ pub _address: u8,
+}
+extern "C" {
+ #[link_name = "_ZN5Usage13static_memberE"]
+ pub static mut Usage_static_member: [u32; 2usize];
+}
+#[test]
+fn bindgen_test_layout_Usage() {
+ assert_eq!(::std::mem::size_of::<Usage>() , 1usize , concat ! (
+ "Size of: " , stringify ! ( Usage ) ));
+ assert_eq! (::std::mem::align_of::<Usage>() , 1usize , concat ! (
+ "Alignment of " , stringify ! ( Usage ) ));
+}
+impl Clone for Usage {
+ fn clone(&self) -> Self { *self }
+}
diff --git a/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs b/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs
new file mode 100644
index 00000000..e88178cf
--- /dev/null
+++ b/tests/expectations/tests/libclang-4/type_alias_template_specialized.rs
@@ -0,0 +1,31 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
+
+
+#[repr(C)]
+#[derive(Debug, Copy)]
+pub struct Rooted {
+ pub ptr: MaybeWrapped<::std::os::raw::c_int>,
+}
+#[test]
+fn bindgen_test_layout_Rooted() {
+ assert_eq!(::std::mem::size_of::<Rooted>() , 4usize , concat ! (
+ "Size of: " , stringify ! ( Rooted ) ));
+ assert_eq! (::std::mem::align_of::<Rooted>() , 4usize , concat ! (
+ "Alignment of " , stringify ! ( Rooted ) ));
+ assert_eq! (unsafe {
+ & ( * ( 0 as * const Rooted ) ) . ptr as * const _ as usize }
+ , 0usize , concat ! (
+ "Alignment of field: " , stringify ! ( Rooted ) , "::" ,
+ stringify ! ( ptr ) ));
+}
+impl Clone for Rooted {
+ fn clone(&self) -> Self { *self }
+}
+impl Default for Rooted {
+ fn default() -> Self { unsafe { ::std::mem::zeroed() } }
+}
+/// <div rustbindgen replaces="MaybeWrapped"></div>
+pub type MaybeWrapped<a> = a;
diff --git a/tests/expectations/tests/macro-expr-basic.rs b/tests/expectations/tests/macro-expr-basic.rs
index 355294e7..7c9bc783 100644
--- a/tests/expectations/tests/macro-expr-basic.rs
+++ b/tests/expectations/tests/macro-expr-basic.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const FOO: ::std::os::raw::c_uint = 1;
diff --git a/tests/expectations/tests/macro-redef.rs b/tests/expectations/tests/macro-redef.rs
index 881a44ae..826f44c2 100644
--- a/tests/expectations/tests/macro-redef.rs
+++ b/tests/expectations/tests/macro-redef.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const FOO: ::std::os::raw::c_uint = 4;
diff --git a/tests/expectations/tests/macro_const.rs b/tests/expectations/tests/macro_const.rs
index 383cedc7..b7b7cc2c 100644
--- a/tests/expectations/tests/macro_const.rs
+++ b/tests/expectations/tests/macro_const.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const foo: &'static [u8; 4usize] = b"bar\x00";
diff --git a/tests/expectations/tests/maddness-is-avoidable.rs b/tests/expectations/tests/maddness-is-avoidable.rs
index 09c1c921..b1eea1d0 100644
--- a/tests/expectations/tests/maddness-is-avoidable.rs
+++ b/tests/expectations/tests/maddness-is-avoidable.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/method-mangling.rs b/tests/expectations/tests/method-mangling.rs
index 360f0ea7..765ca5fb 100644
--- a/tests/expectations/tests/method-mangling.rs
+++ b/tests/expectations/tests/method-mangling.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/module-whitelisted.rs b/tests/expectations/tests/module-whitelisted.rs
index 0f4d54b3..ad2c92fc 100644
--- a/tests/expectations/tests/module-whitelisted.rs
+++ b/tests/expectations/tests/module-whitelisted.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/msvc-no-usr.rs b/tests/expectations/tests/msvc-no-usr.rs
index 7ea253b6..589f8995 100644
--- a/tests/expectations/tests/msvc-no-usr.rs
+++ b/tests/expectations/tests/msvc-no-usr.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs b/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs
index 253d5843..06f1df50 100644
--- a/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs
+++ b/tests/expectations/tests/multiple-inherit-empty-correct-layout.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/mutable.rs b/tests/expectations/tests/mutable.rs
index cde3dac1..9c986137 100644
--- a/tests/expectations/tests/mutable.rs
+++ b/tests/expectations/tests/mutable.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs
index 0fca8d72..1e954298 100644
--- a/tests/expectations/tests/namespace.rs
+++ b/tests/expectations/tests/namespace.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/nested.rs b/tests/expectations/tests/nested.rs
index d50f8e17..929732f6 100644
--- a/tests/expectations/tests/nested.rs
+++ b/tests/expectations/tests/nested.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/nested_vtable.rs b/tests/expectations/tests/nested_vtable.rs
index 4c9dc8f6..dae737d4 100644
--- a/tests/expectations/tests/nested_vtable.rs
+++ b/tests/expectations/tests/nested_vtable.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/nested_within_namespace.rs b/tests/expectations/tests/nested_within_namespace.rs
index c5144657..8021b831 100644
--- a/tests/expectations/tests/nested_within_namespace.rs
+++ b/tests/expectations/tests/nested_within_namespace.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/no-comments.rs b/tests/expectations/tests/no-comments.rs
index 058f2045..e67b156b 100644
--- a/tests/expectations/tests/no-comments.rs
+++ b/tests/expectations/tests/no-comments.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/no-derive-debug.rs b/tests/expectations/tests/no-derive-debug.rs
index 07e6ae82..da320e7e 100644
--- a/tests/expectations/tests/no-derive-debug.rs
+++ b/tests/expectations/tests/no-derive-debug.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)] #[derive(Copy, Clone, Default)] pub struct foo { bar: ::std::os::raw::c_int, }
diff --git a/tests/expectations/tests/no-derive-default.rs b/tests/expectations/tests/no-derive-default.rs
index 2cec9d19..544c29e3 100644
--- a/tests/expectations/tests/no-derive-default.rs
+++ b/tests/expectations/tests/no-derive-default.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct foo { bar: ::std::os::raw::c_int, }
diff --git a/tests/expectations/tests/no-recursive-whitelisting.rs b/tests/expectations/tests/no-recursive-whitelisting.rs
index 7cc3d89e..e2aba543 100644
--- a/tests/expectations/tests/no-recursive-whitelisting.rs
+++ b/tests/expectations/tests/no-recursive-whitelisting.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub enum Bar {}
diff --git a/tests/expectations/tests/no-std.rs b/tests/expectations/tests/no-std.rs
index 998ac2a8..41b3b184 100644
--- a/tests/expectations/tests/no-std.rs
+++ b/tests/expectations/tests/no-std.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![no_std]
mod libc { pub type c_int = i32; pub enum c_void {} }
diff --git a/tests/expectations/tests/no_copy.rs b/tests/expectations/tests/no_copy.rs
index a75f891c..0560c37e 100644
--- a/tests/expectations/tests/no_copy.rs
+++ b/tests/expectations/tests/no_copy.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/** <div rustbindgen nocopy></div> */
diff --git a/tests/expectations/tests/non-type-params.rs b/tests/expectations/tests/non-type-params.rs
index 7470d28f..c7ac4e85 100644
--- a/tests/expectations/tests/non-type-params.rs
+++ b/tests/expectations/tests/non-type-params.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type Array16 = u8;
diff --git a/tests/expectations/tests/nsStyleAutoArray.rs b/tests/expectations/tests/nsStyleAutoArray.rs
index ea68980d..d9287e00 100644
--- a/tests/expectations/tests/nsStyleAutoArray.rs
+++ b/tests/expectations/tests/nsStyleAutoArray.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/objc_category.rs b/tests/expectations/tests/objc_category.rs
index d358e132..2f29adc9 100644
--- a/tests/expectations/tests/objc_category.rs
+++ b/tests/expectations/tests/objc_category.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_class.rs b/tests/expectations/tests/objc_class.rs
index 9aa30c1a..21f7c0d1 100644
--- a/tests/expectations/tests/objc_class.rs
+++ b/tests/expectations/tests/objc_class.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_class_method.rs b/tests/expectations/tests/objc_class_method.rs
index 699f5619..640ae07f 100644
--- a/tests/expectations/tests/objc_class_method.rs
+++ b/tests/expectations/tests/objc_class_method.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_interface.rs b/tests/expectations/tests/objc_interface.rs
index 3ca67b89..1108219d 100644
--- a/tests/expectations/tests/objc_interface.rs
+++ b/tests/expectations/tests/objc_interface.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_interface_type.rs b/tests/expectations/tests/objc_interface_type.rs
index edf551d3..a43b3e69 100644
--- a/tests/expectations/tests/objc_interface_type.rs
+++ b/tests/expectations/tests/objc_interface_type.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_method.rs b/tests/expectations/tests/objc_method.rs
index d0342a21..2b57a938 100644
--- a/tests/expectations/tests/objc_method.rs
+++ b/tests/expectations/tests/objc_method.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_method_clash.rs b/tests/expectations/tests/objc_method_clash.rs
index 07dedc4c..88c2bd28 100644
--- a/tests/expectations/tests/objc_method_clash.rs
+++ b/tests/expectations/tests/objc_method_clash.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_property_fnptr.rs b/tests/expectations/tests/objc_property_fnptr.rs
index 044f25d1..2d7e08ed 100644
--- a/tests/expectations/tests/objc_property_fnptr.rs
+++ b/tests/expectations/tests/objc_property_fnptr.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_protocol.rs b/tests/expectations/tests/objc_protocol.rs
index a21d4baa..aa7e7291 100644
--- a/tests/expectations/tests/objc_protocol.rs
+++ b/tests/expectations/tests/objc_protocol.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_sel_and_id.rs b/tests/expectations/tests/objc_sel_and_id.rs
index d72b0bc7..0784c21e 100644
--- a/tests/expectations/tests/objc_sel_and_id.rs
+++ b/tests/expectations/tests/objc_sel_and_id.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/objc_whitelist.rs b/tests/expectations/tests/objc_whitelist.rs
index b0418f38..1f722b70 100644
--- a/tests/expectations/tests/objc_whitelist.rs
+++ b/tests/expectations/tests/objc_whitelist.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![cfg(target_os="macos")]
diff --git a/tests/expectations/tests/only_bitfields.rs b/tests/expectations/tests/only_bitfields.rs
index f30d218f..a47a466c 100644
--- a/tests/expectations/tests/only_bitfields.rs
+++ b/tests/expectations/tests/only_bitfields.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/opaque-tracing.rs b/tests/expectations/tests/opaque-tracing.rs
index c7534d97..fc91a6ce 100644
--- a/tests/expectations/tests/opaque-tracing.rs
+++ b/tests/expectations/tests/opaque-tracing.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/opaque_in_struct.rs b/tests/expectations/tests/opaque_in_struct.rs
index f689b02b..9ca0b667 100644
--- a/tests/expectations/tests/opaque_in_struct.rs
+++ b/tests/expectations/tests/opaque_in_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/** <div rustbindgen opaque> */
diff --git a/tests/expectations/tests/opaque_pointer.rs b/tests/expectations/tests/opaque_pointer.rs
index 1a2da431..3462f4c3 100644
--- a/tests/expectations/tests/opaque_pointer.rs
+++ b/tests/expectations/tests/opaque_pointer.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/**
diff --git a/tests/expectations/tests/opaque_typedef.rs b/tests/expectations/tests/opaque_typedef.rs
index 34b40ff6..31742854 100644
--- a/tests/expectations/tests/opaque_typedef.rs
+++ b/tests/expectations/tests/opaque_typedef.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/overflowed_enum.rs b/tests/expectations/tests/overflowed_enum.rs
index 9e1f8a7f..bc4a5347 100644
--- a/tests/expectations/tests/overflowed_enum.rs
+++ b/tests/expectations/tests/overflowed_enum.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(u32)]
diff --git a/tests/expectations/tests/overloading.rs b/tests/expectations/tests/overloading.rs
index 71002e23..45c3ead1 100644
--- a/tests/expectations/tests/overloading.rs
+++ b/tests/expectations/tests/overloading.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/prepend_enum_name.rs b/tests/expectations/tests/prepend_enum_name.rs
index d95bd1b4..c409e54a 100644
--- a/tests/expectations/tests/prepend_enum_name.rs
+++ b/tests/expectations/tests/prepend_enum_name.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const FOO_BAR: foo = 0;
diff --git a/tests/expectations/tests/private.rs b/tests/expectations/tests/private.rs
index a9fbef9f..301ce230 100644
--- a/tests/expectations/tests/private.rs
+++ b/tests/expectations/tests/private.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/public-dtor.rs b/tests/expectations/tests/public-dtor.rs
index d24e863e..bf8f1e58 100644
--- a/tests/expectations/tests/public-dtor.rs
+++ b/tests/expectations/tests/public-dtor.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/redeclaration.rs b/tests/expectations/tests/redeclaration.rs
index 0d7e585c..87df5e4a 100644
--- a/tests/expectations/tests/redeclaration.rs
+++ b/tests/expectations/tests/redeclaration.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/ref_argument_array.rs b/tests/expectations/tests/ref_argument_array.rs
index 51531824..25187918 100644
--- a/tests/expectations/tests/ref_argument_array.rs
+++ b/tests/expectations/tests/ref_argument_array.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const NSID_LENGTH: ::std::os::raw::c_uint = 10;
diff --git a/tests/expectations/tests/reparented_replacement.rs b/tests/expectations/tests/reparented_replacement.rs
index 93cd3012..c9e85911 100644
--- a/tests/expectations/tests/reparented_replacement.rs
+++ b/tests/expectations/tests/reparented_replacement.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/replace_template_alias.rs b/tests/expectations/tests/replace_template_alias.rs
index 4de44d25..8d837341 100644
--- a/tests/expectations/tests/replace_template_alias.rs
+++ b/tests/expectations/tests/replace_template_alias.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/// But the replacement type does use T!
diff --git a/tests/expectations/tests/replace_use.rs b/tests/expectations/tests/replace_use.rs
index 6cdc3263..0c35be56 100644
--- a/tests/expectations/tests/replace_use.rs
+++ b/tests/expectations/tests/replace_use.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
/**
diff --git a/tests/expectations/tests/replaces_double.rs b/tests/expectations/tests/replaces_double.rs
index f3bc0bf4..aab511ec 100644
--- a/tests/expectations/tests/replaces_double.rs
+++ b/tests/expectations/tests/replaces_double.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/resolved_type_def_function.rs b/tests/expectations/tests/resolved_type_def_function.rs
index 83f07dd0..f400c9fe 100644
--- a/tests/expectations/tests/resolved_type_def_function.rs
+++ b/tests/expectations/tests/resolved_type_def_function.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type FuncType = ::std::option::Option<unsafe extern "C" fn()>;
diff --git a/tests/expectations/tests/same_struct_name_in_different_namespaces.rs b/tests/expectations/tests/same_struct_name_in_different_namespaces.rs
index 6ea05143..e406cf33 100644
--- a/tests/expectations/tests/same_struct_name_in_different_namespaces.rs
+++ b/tests/expectations/tests/same_struct_name_in_different_namespaces.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/short-enums.rs b/tests/expectations/tests/short-enums.rs
index 55bf2105..73eb45d7 100644
--- a/tests/expectations/tests/short-enums.rs
+++ b/tests/expectations/tests/short-enums.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(u8)]
diff --git a/tests/expectations/tests/size_t_template.rs b/tests/expectations/tests/size_t_template.rs
index b2680869..937a8c72 100644
--- a/tests/expectations/tests/size_t_template.rs
+++ b/tests/expectations/tests/size_t_template.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_containing_forward_declared_struct.rs b/tests/expectations/tests/struct_containing_forward_declared_struct.rs
index 58ab04c9..6b243732 100644
--- a/tests/expectations/tests/struct_containing_forward_declared_struct.rs
+++ b/tests/expectations/tests/struct_containing_forward_declared_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_typedef.rs b/tests/expectations/tests/struct_typedef.rs
index 63811bda..4f41e187 100644
--- a/tests/expectations/tests/struct_typedef.rs
+++ b/tests/expectations/tests/struct_typedef.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_typedef_ns.rs b/tests/expectations/tests/struct_typedef_ns.rs
index 9f2c3b34..e436beb2 100644
--- a/tests/expectations/tests/struct_typedef_ns.rs
+++ b/tests/expectations/tests/struct_typedef_ns.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/struct_with_anon_struct.rs b/tests/expectations/tests/struct_with_anon_struct.rs
index b02fdd0e..015e7d86 100644
--- a/tests/expectations/tests/struct_with_anon_struct.rs
+++ b/tests/expectations/tests/struct_with_anon_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_anon_struct_array.rs b/tests/expectations/tests/struct_with_anon_struct_array.rs
index a19c957b..8934e8a6 100644
--- a/tests/expectations/tests/struct_with_anon_struct_array.rs
+++ b/tests/expectations/tests/struct_with_anon_struct_array.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_anon_struct_pointer.rs b/tests/expectations/tests/struct_with_anon_struct_pointer.rs
index e0b06f76..cba5b8a6 100644
--- a/tests/expectations/tests/struct_with_anon_struct_pointer.rs
+++ b/tests/expectations/tests/struct_with_anon_struct_pointer.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_anon_union.rs b/tests/expectations/tests/struct_with_anon_union.rs
index aff61c45..5984ba6e 100644
--- a/tests/expectations/tests/struct_with_anon_union.rs
+++ b/tests/expectations/tests/struct_with_anon_union.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs b/tests/expectations/tests/struct_with_anon_unnamed_struct.rs
index 80039415..a7374bc4 100644
--- a/tests/expectations/tests/struct_with_anon_unnamed_struct.rs
+++ b/tests/expectations/tests/struct_with_anon_unnamed_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_anon_unnamed_union.rs b/tests/expectations/tests/struct_with_anon_unnamed_union.rs
index f55d8e38..09dbbb59 100644
--- a/tests/expectations/tests/struct_with_anon_unnamed_union.rs
+++ b/tests/expectations/tests/struct_with_anon_unnamed_union.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_bitfields.rs b/tests/expectations/tests/struct_with_bitfields.rs
index dc26bd06..135cf087 100644
--- a/tests/expectations/tests/struct_with_bitfields.rs
+++ b/tests/expectations/tests/struct_with_bitfields.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_derive_debug.rs b/tests/expectations/tests/struct_with_derive_debug.rs
index 58a94853..bbe78898 100644
--- a/tests/expectations/tests/struct_with_derive_debug.rs
+++ b/tests/expectations/tests/struct_with_derive_debug.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_nesting.rs b/tests/expectations/tests/struct_with_nesting.rs
index 30ba124b..1a8e887d 100644
--- a/tests/expectations/tests/struct_with_nesting.rs
+++ b/tests/expectations/tests/struct_with_nesting.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_packing.rs b/tests/expectations/tests/struct_with_packing.rs
index cba3d475..abeb0b83 100644
--- a/tests/expectations/tests/struct_with_packing.rs
+++ b/tests/expectations/tests/struct_with_packing.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C, packed)]
diff --git a/tests/expectations/tests/struct_with_struct.rs b/tests/expectations/tests/struct_with_struct.rs
index bcdaada2..1ad359f3 100644
--- a/tests/expectations/tests/struct_with_struct.rs
+++ b/tests/expectations/tests/struct_with_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/struct_with_typedef_template_arg.rs b/tests/expectations/tests/struct_with_typedef_template_arg.rs
index 93620e59..9066e037 100644
--- a/tests/expectations/tests/struct_with_typedef_template_arg.rs
+++ b/tests/expectations/tests/struct_with_typedef_template_arg.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-fun-ty.rs b/tests/expectations/tests/template-fun-ty.rs
index 05351d7d..30571266 100644
--- a/tests/expectations/tests/template-fun-ty.rs
+++ b/tests/expectations/tests/template-fun-ty.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-0.rs b/tests/expectations/tests/template-param-usage-0.rs
index c782132b..4f74a144 100644
--- a/tests/expectations/tests/template-param-usage-0.rs
+++ b/tests/expectations/tests/template-param-usage-0.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-1.rs b/tests/expectations/tests/template-param-usage-1.rs
index 0fd8719b..95e41077 100644
--- a/tests/expectations/tests/template-param-usage-1.rs
+++ b/tests/expectations/tests/template-param-usage-1.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-10.rs b/tests/expectations/tests/template-param-usage-10.rs
index bee2ffd0..a01597c1 100644
--- a/tests/expectations/tests/template-param-usage-10.rs
+++ b/tests/expectations/tests/template-param-usage-10.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-11.rs b/tests/expectations/tests/template-param-usage-11.rs
index a8959b99..1b2335bb 100644
--- a/tests/expectations/tests/template-param-usage-11.rs
+++ b/tests/expectations/tests/template-param-usage-11.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-12.rs b/tests/expectations/tests/template-param-usage-12.rs
index 0823de1e..5912bdf5 100644
--- a/tests/expectations/tests/template-param-usage-12.rs
+++ b/tests/expectations/tests/template-param-usage-12.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-13.rs b/tests/expectations/tests/template-param-usage-13.rs
index 0d850c7b..4721968f 100644
--- a/tests/expectations/tests/template-param-usage-13.rs
+++ b/tests/expectations/tests/template-param-usage-13.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-14.rs b/tests/expectations/tests/template-param-usage-14.rs
index fae4afdc..d4c86652 100644
--- a/tests/expectations/tests/template-param-usage-14.rs
+++ b/tests/expectations/tests/template-param-usage-14.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-15.rs b/tests/expectations/tests/template-param-usage-15.rs
index 060c6e07..9b7f30ec 100644
--- a/tests/expectations/tests/template-param-usage-15.rs
+++ b/tests/expectations/tests/template-param-usage-15.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-2.rs b/tests/expectations/tests/template-param-usage-2.rs
index 008826b6..d017976b 100644
--- a/tests/expectations/tests/template-param-usage-2.rs
+++ b/tests/expectations/tests/template-param-usage-2.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-3.rs b/tests/expectations/tests/template-param-usage-3.rs
index 5a94b95d..85a96d54 100644
--- a/tests/expectations/tests/template-param-usage-3.rs
+++ b/tests/expectations/tests/template-param-usage-3.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-4.rs b/tests/expectations/tests/template-param-usage-4.rs
index f95a4c60..5e9e004c 100644
--- a/tests/expectations/tests/template-param-usage-4.rs
+++ b/tests/expectations/tests/template-param-usage-4.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-5.rs b/tests/expectations/tests/template-param-usage-5.rs
index d719dbc8..375a60df 100644
--- a/tests/expectations/tests/template-param-usage-5.rs
+++ b/tests/expectations/tests/template-param-usage-5.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-6.rs b/tests/expectations/tests/template-param-usage-6.rs
index 37b7fe64..f76e6326 100644
--- a/tests/expectations/tests/template-param-usage-6.rs
+++ b/tests/expectations/tests/template-param-usage-6.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-7.rs b/tests/expectations/tests/template-param-usage-7.rs
index 326917fc..38b3e832 100644
--- a/tests/expectations/tests/template-param-usage-7.rs
+++ b/tests/expectations/tests/template-param-usage-7.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-8.rs b/tests/expectations/tests/template-param-usage-8.rs
index 55c39e19..9a0f428f 100644
--- a/tests/expectations/tests/template-param-usage-8.rs
+++ b/tests/expectations/tests/template-param-usage-8.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template-param-usage-9.rs b/tests/expectations/tests/template-param-usage-9.rs
index ec6c66b2..88fea725 100644
--- a/tests/expectations/tests/template-param-usage-9.rs
+++ b/tests/expectations/tests/template-param-usage-9.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template.rs b/tests/expectations/tests/template.rs
index c5eb2a27..5eed8c47 100644
--- a/tests/expectations/tests/template.rs
+++ b/tests/expectations/tests/template.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template_alias.rs b/tests/expectations/tests/template_alias.rs
index c440c278..a718e704 100644
--- a/tests/expectations/tests/template_alias.rs
+++ b/tests/expectations/tests/template_alias.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type JS_detail_Wrapped<T> = T;
diff --git a/tests/expectations/tests/template_alias_basic.rs b/tests/expectations/tests/template_alias_basic.rs
index 656fff33..29f3b7c7 100644
--- a/tests/expectations/tests/template_alias_basic.rs
+++ b/tests/expectations/tests/template_alias_basic.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type Wrapped<T> = T;
diff --git a/tests/expectations/tests/template_alias_namespace.rs b/tests/expectations/tests/template_alias_namespace.rs
index dfcbe367..2fb88a81 100644
--- a/tests/expectations/tests/template_alias_namespace.rs
+++ b/tests/expectations/tests/template_alias_namespace.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/template_partial_specification.rs b/tests/expectations/tests/template_partial_specification.rs
index b4b7b2bc..2ca90d40 100644
--- a/tests/expectations/tests/template_partial_specification.rs
+++ b/tests/expectations/tests/template_partial_specification.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/template_typedef_transitive_param.rs b/tests/expectations/tests/template_typedef_transitive_param.rs
index cc360cd1..05604223 100644
--- a/tests/expectations/tests/template_typedef_transitive_param.rs
+++ b/tests/expectations/tests/template_typedef_transitive_param.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/template_typedefs.rs b/tests/expectations/tests/template_typedefs.rs
index c987bf8e..d18783ad 100644
--- a/tests/expectations/tests/template_typedefs.rs
+++ b/tests/expectations/tests/template_typedefs.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type foo =
diff --git a/tests/expectations/tests/templateref_opaque.rs b/tests/expectations/tests/templateref_opaque.rs
index 89808f30..5f6a7459 100644
--- a/tests/expectations/tests/templateref_opaque.rs
+++ b/tests/expectations/tests/templateref_opaque.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs b/tests/expectations/tests/type-referenced-by-whitelisted-function.rs
index 67381d41..63d64654 100644
--- a/tests/expectations/tests/type-referenced-by-whitelisted-function.rs
+++ b/tests/expectations/tests/type-referenced-by-whitelisted-function.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/type_alias_empty.rs b/tests/expectations/tests/type_alias_empty.rs
index c455b8ae..d0f18ded 100644
--- a/tests/expectations/tests/type_alias_empty.rs
+++ b/tests/expectations/tests/type_alias_empty.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type bool_constant = u8;
diff --git a/tests/expectations/tests/type_alias_partial_template_especialization.rs b/tests/expectations/tests/type_alias_partial_template_especialization.rs
index a3970c68..21d198a6 100644
--- a/tests/expectations/tests/type_alias_partial_template_especialization.rs
+++ b/tests/expectations/tests/type_alias_partial_template_especialization.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type MaybeWrapped<A> = A;
diff --git a/tests/expectations/tests/typedefd-array-as-function-arg.rs b/tests/expectations/tests/typedefd-array-as-function-arg.rs
index 56074f75..e4e1cba5 100644
--- a/tests/expectations/tests/typedefd-array-as-function-arg.rs
+++ b/tests/expectations/tests/typedefd-array-as-function-arg.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub type myVector3 = [f32; 3usize];
diff --git a/tests/expectations/tests/typeref.rs b/tests/expectations/tests/typeref.rs
index c9982b67..b5be5557 100644
--- a/tests/expectations/tests/typeref.rs
+++ b/tests/expectations/tests/typeref.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union-in-ns.rs b/tests/expectations/tests/union-in-ns.rs
index e5aeb368..8beb7a92 100644
--- a/tests/expectations/tests/union-in-ns.rs
+++ b/tests/expectations/tests/union-in-ns.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/union_dtor.rs b/tests/expectations/tests/union_dtor.rs
index 61fb0380..429ec082 100644
--- a/tests/expectations/tests/union_dtor.rs
+++ b/tests/expectations/tests/union_dtor.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_fields.rs b/tests/expectations/tests/union_fields.rs
index 8c8ef7d5..45ce6473 100644
--- a/tests/expectations/tests/union_fields.rs
+++ b/tests/expectations/tests/union_fields.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_template.rs b/tests/expectations/tests/union_template.rs
index e02f1964..7f30e7b4 100644
--- a/tests/expectations/tests/union_template.rs
+++ b/tests/expectations/tests/union_template.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_with_anon_struct.rs b/tests/expectations/tests/union_with_anon_struct.rs
index 59f8fcab..f0bb68d5 100644
--- a/tests/expectations/tests/union_with_anon_struct.rs
+++ b/tests/expectations/tests/union_with_anon_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_with_anon_struct_bitfield.rs b/tests/expectations/tests/union_with_anon_struct_bitfield.rs
index c9bf8ed1..cf3ab206 100644
--- a/tests/expectations/tests/union_with_anon_struct_bitfield.rs
+++ b/tests/expectations/tests/union_with_anon_struct_bitfield.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_with_anon_union.rs b/tests/expectations/tests/union_with_anon_union.rs
index 9e182d21..668160a7 100644
--- a/tests/expectations/tests/union_with_anon_union.rs
+++ b/tests/expectations/tests/union_with_anon_union.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_with_anon_unnamed_struct.rs b/tests/expectations/tests/union_with_anon_unnamed_struct.rs
index 4d0b639f..98524422 100644
--- a/tests/expectations/tests/union_with_anon_unnamed_struct.rs
+++ b/tests/expectations/tests/union_with_anon_unnamed_struct.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_with_anon_unnamed_union.rs b/tests/expectations/tests/union_with_anon_unnamed_union.rs
index fd6f82fc..1a6f5f45 100644
--- a/tests/expectations/tests/union_with_anon_unnamed_union.rs
+++ b/tests/expectations/tests/union_with_anon_unnamed_union.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_with_big_member.rs b/tests/expectations/tests/union_with_big_member.rs
index 2b7a8eef..679832fd 100644
--- a/tests/expectations/tests/union_with_big_member.rs
+++ b/tests/expectations/tests/union_with_big_member.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/union_with_nesting.rs b/tests/expectations/tests/union_with_nesting.rs
index d92e8efa..7e32f0c0 100644
--- a/tests/expectations/tests/union_with_nesting.rs
+++ b/tests/expectations/tests/union_with_nesting.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/unknown_attr.rs b/tests/expectations/tests/unknown_attr.rs
index 23d9ff75..dcd1e18e 100644
--- a/tests/expectations/tests/unknown_attr.rs
+++ b/tests/expectations/tests/unknown_attr.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/use-core.rs b/tests/expectations/tests/use-core.rs
index c2996f74..14ac1373 100644
--- a/tests/expectations/tests/use-core.rs
+++ b/tests/expectations/tests/use-core.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern crate core;
diff --git a/tests/expectations/tests/using.rs b/tests/expectations/tests/using.rs
index 2997bcf5..0dc1ec21 100644
--- a/tests/expectations/tests/using.rs
+++ b/tests/expectations/tests/using.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/var-tracing.rs b/tests/expectations/tests/var-tracing.rs
index ba10cf22..3eb93b04 100644
--- a/tests/expectations/tests/var-tracing.rs
+++ b/tests/expectations/tests/var-tracing.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/variadic-method.rs b/tests/expectations/tests/variadic-method.rs
index 542e1e75..a68dd1c9 100644
--- a/tests/expectations/tests/variadic-method.rs
+++ b/tests/expectations/tests/variadic-method.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
extern "C" {
diff --git a/tests/expectations/tests/variadic_template_function.rs b/tests/expectations/tests/variadic_template_function.rs
index 66fd73ed..e14da64f 100644
--- a/tests/expectations/tests/variadic_template_function.rs
+++ b/tests/expectations/tests/variadic_template_function.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/vector.rs b/tests/expectations/tests/vector.rs
index 31bc8fd7..a4b87c7f 100644
--- a/tests/expectations/tests/vector.rs
+++ b/tests/expectations/tests/vector.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/virtual_dtor.rs b/tests/expectations/tests/virtual_dtor.rs
index e5d3ace2..9a6ee13e 100644
--- a/tests/expectations/tests/virtual_dtor.rs
+++ b/tests/expectations/tests/virtual_dtor.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/virtual_inheritance.rs b/tests/expectations/tests/virtual_inheritance.rs
index b3119ca7..e177dca8 100644
--- a/tests/expectations/tests/virtual_inheritance.rs
+++ b/tests/expectations/tests/virtual_inheritance.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/virtual_overloaded.rs b/tests/expectations/tests/virtual_overloaded.rs
index 625abe3b..a0489685 100644
--- a/tests/expectations/tests/virtual_overloaded.rs
+++ b/tests/expectations/tests/virtual_overloaded.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/vtable_recursive_sig.rs b/tests/expectations/tests/vtable_recursive_sig.rs
index 0faf37ac..9a8b5be6 100644
--- a/tests/expectations/tests/vtable_recursive_sig.rs
+++ b/tests/expectations/tests/vtable_recursive_sig.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/weird_bitfields.rs b/tests/expectations/tests/weird_bitfields.rs
index 0bf90dda..413b7103 100644
--- a/tests/expectations/tests/weird_bitfields.rs
+++ b/tests/expectations/tests/weird_bitfields.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(u32)]
diff --git a/tests/expectations/tests/what_is_going_on.rs b/tests/expectations/tests/what_is_going_on.rs
index 388fe472..daa6407b 100644
--- a/tests/expectations/tests/what_is_going_on.rs
+++ b/tests/expectations/tests/what_is_going_on.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/whitelist-namespaces-basic.rs b/tests/expectations/tests/whitelist-namespaces-basic.rs
index 6a1e9029..bdb35589 100644
--- a/tests/expectations/tests/whitelist-namespaces-basic.rs
+++ b/tests/expectations/tests/whitelist-namespaces-basic.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/whitelist-namespaces.rs b/tests/expectations/tests/whitelist-namespaces.rs
index 0c6cc4b6..e19bdba3 100644
--- a/tests/expectations/tests/whitelist-namespaces.rs
+++ b/tests/expectations/tests/whitelist-namespaces.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
diff --git a/tests/expectations/tests/whitelist_basic.rs b/tests/expectations/tests/whitelist_basic.rs
index 0eeeba4e..af151e3e 100644
--- a/tests/expectations/tests/whitelist_basic.rs
+++ b/tests/expectations/tests/whitelist_basic.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
#[repr(C)]
diff --git a/tests/expectations/tests/whitelist_fix.rs b/tests/expectations/tests/whitelist_fix.rs
index 9e26e1be..ed30347c 100644
--- a/tests/expectations/tests/whitelist_fix.rs
+++ b/tests/expectations/tests/whitelist_fix.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub enum Test {}
diff --git a/tests/expectations/tests/whitelist_vars.rs b/tests/expectations/tests/whitelist_vars.rs
index f7af24b2..e9e01fe1 100644
--- a/tests/expectations/tests/whitelist_vars.rs
+++ b/tests/expectations/tests/whitelist_vars.rs
@@ -1,7 +1,7 @@
/* automatically generated by rust-bindgen */
-#![allow(non_snake_case)]
+#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub const NONE: ::std::os::raw::c_uint = 0;
diff --git a/tests/stylo_sanity.rs b/tests/stylo_sanity.rs
index c75d65a4..c8a8a0d5 100755
--- a/tests/stylo_sanity.rs
+++ b/tests/stylo_sanity.rs
@@ -14,7 +14,9 @@ extern crate bindgen;
#[test]
#[cfg(not(any(debug_assertions,
feature = "testing_only_extra_assertions",
- feature = "testing_only_llvm_stable")))]
+ feature = "testing_only_libclang_3_8")))]
+#[cfg(any(feature = "testing_only_libclang_3_9",
+ feature = "testing_only_libclang_4"))]
fn sanity_check_can_generate_stylo_bindings() {
use std::time::Instant;
diff --git a/tests/test-one.sh b/tests/test-one.sh
index 7f0cda74..ac466164 100755
--- a/tests/test-one.sh
+++ b/tests/test-one.sh
@@ -24,7 +24,7 @@ TEST_BINDINGS_BINARY=$(mktemp -t bindings.XXXXXX)
FLAGS="$(grep "// bindgen-flags: " "$TEST" || echo)"
FLAGS="${FLAGS/\/\/ bindgen\-flags:/}"
# Prepend the default flags added in test.rs's `create_bindgen_builder`.
-FLAGS="--no-unstable-rust --with-derive-default --raw-line '' --raw-line '#![allow(non_snake_case)]' --raw-line '' $FLAGS"
+FLAGS="--no-unstable-rust --with-derive-default --raw-line '' --raw-line '#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]' --raw-line '' $FLAGS"
eval ./target/debug/bindgen \
diff --git a/tests/tests.rs b/tests/tests.rs
index 9265b021..46f83155 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -26,6 +26,30 @@ fn compare_generated_header(header: &PathBuf,
expected.push(file_name);
expected.set_extension("rs");
+ // If the expectation file doesn't exist, see if we have different test
+ // expectations for different libclang versions.
+ if !expected.is_file() {
+ let file_name = expected.file_name().unwrap().to_owned();
+ expected.pop();
+
+ if cfg!(feature = "testing_only_libclang_4") {
+ expected.push("libclang-4");
+ } else if cfg!(feature = "testing_only_libclang_3_9") {
+ expected.push("libclang-3.9");
+ } else if cfg!(feature = "testing_only_libclang_3_8") {
+ expected.push("libclang-3.8");
+ }
+
+ expected.push(file_name);
+
+ if !expected.is_file() {
+ panic!("missing test expectation file and/or 'testing_only_libclang_$VERSION' \
+ feature for header '{}'; looking for expectation file at '{}'",
+ header.display(),
+ expected.display());
+ }
+ }
+
// We skip the generate() error here so we get a full diff below
let output = match builder.generate() {
Ok(bindings) => bindings.to_string(),
@@ -87,9 +111,6 @@ fn create_bindgen_builder(header: &PathBuf) -> Result<Option<Builder>, Error> {
.and_then(shlex::split)
.unwrap();
flags.extend(extra_flags.into_iter());
- } else if line.contains("bindgen-unstable") &&
- cfg!(feature = "testing_only_llvm_stable") {
- return Ok(None);
} else if line.contains("bindgen-osx-only") {
let prepend_flags = ["--raw-line", "#![cfg(target_os=\"macos\")]"];
flags = prepend_flags.into_iter()
@@ -116,7 +137,7 @@ fn create_bindgen_builder(header: &PathBuf) -> Result<Option<Builder>, Error> {
"--raw-line",
"",
"--raw-line",
- "#![allow(non_snake_case)]",
+ "#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]",
"--raw-line",
""];