From fbb6d6f6240895d224ee3b475f8739b414fbc564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 19 Jan 2018 15:40:58 +0100 Subject: [PATCH] codegen: Don't generate repr(C) for enums. That's only undefined for enums with fields. Fixes #1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2 --- src/codegen/mod.rs | 4 +--- tests/expectations/tests/anon_enum.rs | 4 ---- tests/expectations/tests/anon_enum_trait.rs | 4 ---- tests/expectations/tests/anon_enum_whitelist.rs | 3 --- tests/expectations/tests/anon_union.rs | 3 --- tests/expectations/tests/anon_union_1_0.rs | 3 --- tests/expectations/tests/bitfield_align_2.rs | 3 --- tests/expectations/tests/class_with_inner_struct.rs | 3 --- .../expectations/tests/class_with_inner_struct_1_0.rs | 3 --- tests/expectations/tests/const_enum_unnamed.rs | 4 ---- tests/expectations/tests/constify-enum.rs | 3 --- tests/expectations/tests/empty-enum.rs | 5 ----- tests/expectations/tests/enum.rs | 4 ---- tests/expectations/tests/enum_alias.rs | 3 --- tests/expectations/tests/enum_and_vtable_mangling.rs | 3 --- tests/expectations/tests/enum_dupe.rs | 3 --- tests/expectations/tests/enum_explicit_type.rs | 8 -------- .../tests/enum_in_template_with_typedef.rs | 3 --- tests/expectations/tests/enum_negative.rs | 3 --- tests/expectations/tests/enum_packed.rs | 5 ----- tests/expectations/tests/forward-enum-decl.rs | 3 --- tests/expectations/tests/func_ptr_in_struct.rs | 3 --- tests/expectations/tests/issue-372.rs | 3 --- tests/expectations/tests/issue-410.rs | 3 --- tests/expectations/tests/issue-493.rs | 4 ---- tests/expectations/tests/issue-493_1_0.rs | 4 ---- ...ype-template-params-causing-layout-test-failures.rs | 3 --- .../expectations/tests/issue-888-enum-var-decl-jump.rs | 3 --- tests/expectations/tests/jsval_layout_opaque.rs | 6 ------ tests/expectations/tests/jsval_layout_opaque_1_0.rs | 6 ------ tests/expectations/tests/layout_array_too_long.rs | 3 --- tests/expectations/tests/layout_cmdline_token.rs | 4 ---- tests/expectations/tests/layout_eth_conf.rs | 10 ---------- tests/expectations/tests/layout_eth_conf_1_0.rs | 10 ---------- tests/expectations/tests/layout_large_align_field.rs | 3 --- .../tests/libclang-3.8/constant-evaluate.rs | 1 - .../tests/libclang-3.9/constant-evaluate.rs | 1 - .../expectations/tests/libclang-4/constant-evaluate.rs | 3 --- tests/expectations/tests/nsStyleAutoArray.rs | 3 --- tests/expectations/tests/overflowed_enum.rs | 4 ---- .../tests/prepend-enum-constified-variant.rs | 3 --- tests/expectations/tests/short-enums.rs | 5 ----- tests/expectations/tests/struct_typedef.rs | 4 ---- tests/expectations/tests/struct_typedef_ns.rs | 4 ---- tests/expectations/tests/weird_bitfields.rs | 3 --- 45 files changed, 1 insertion(+), 172 deletions(-) diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 16ff79fb8c..5641b84d30 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -2442,9 +2442,7 @@ impl CodeGenerator for Enum { // TODO(emilio): Delegate this to the builders? if variation.is_rust() { attrs.push(attributes::repr(repr_name)); - } - - if variation.is_bitfield() || variation.is_rust() { + } else if variation.is_bitfield() { attrs.push(attributes::repr("C")); } diff --git a/tests/expectations/tests/anon_enum.rs b/tests/expectations/tests/anon_enum.rs index c482530c87..76d6089f90 100644 --- a/tests/expectations/tests/anon_enum.rs +++ b/tests/expectations/tests/anon_enum.rs @@ -1,9 +1,7 @@ /* 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, PartialEq)] pub struct Test { @@ -12,7 +10,6 @@ pub struct Test { } pub const Test_T_NONE: Test__bindgen_ty_1 = Test__bindgen_ty_1::T_NONE; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Test__bindgen_ty_1 { T_NONE = 0, @@ -41,7 +38,6 @@ fn bindgen_test_layout_Test() { ); } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Baz { Foo = 0, diff --git a/tests/expectations/tests/anon_enum_trait.rs b/tests/expectations/tests/anon_enum_trait.rs index 21d2287944..6eb9f4407e 100644 --- a/tests/expectations/tests/anon_enum_trait.rs +++ b/tests/expectations/tests/anon_enum_trait.rs @@ -1,9 +1,7 @@ /* 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, Hash, PartialEq, Eq)] pub struct DataType { @@ -19,7 +17,6 @@ pub const DataType_channels: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::ge pub const DataType_fmt: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type; pub const DataType_type_: DataType__bindgen_ty_1 = DataType__bindgen_ty_1::generic_type; #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum DataType__bindgen_ty_1 { generic_type = 0, @@ -32,7 +29,6 @@ pub struct Foo { pub const Foo_Bar: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::Bar; pub const Foo_Baz: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::Bar; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo__bindgen_ty_1 { Bar = 0, diff --git a/tests/expectations/tests/anon_enum_whitelist.rs b/tests/expectations/tests/anon_enum_whitelist.rs index 45b858fdea..267d922961 100644 --- a/tests/expectations/tests/anon_enum_whitelist.rs +++ b/tests/expectations/tests/anon_enum_whitelist.rs @@ -1,13 +1,10 @@ /* automatically generated by rust-bindgen */ - #![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; pub const NODE_FLAG_BAR: _bindgen_ty_1 = _bindgen_ty_1::NODE_FLAG_BAR; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { NODE_FLAG_FOO = 0, diff --git a/tests/expectations/tests/anon_union.rs b/tests/expectations/tests/anon_union.rs index da990ae9aa..689279142f 100644 --- a/tests/expectations/tests/anon_union.rs +++ b/tests/expectations/tests/anon_union.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] pub struct TErrorResult { pub mResult: ::std::os::raw::c_int, @@ -14,7 +12,6 @@ pub struct TErrorResult { pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState = TErrorResult_UnionState::HasMessage; #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TErrorResult_UnionState { HasMessage = 0, diff --git a/tests/expectations/tests/anon_union_1_0.rs b/tests/expectations/tests/anon_union_1_0.rs index 67a332c01c..80111b9044 100644 --- a/tests/expectations/tests/anon_union_1_0.rs +++ b/tests/expectations/tests/anon_union_1_0.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] pub struct __BindgenUnionField(::std::marker::PhantomData); impl __BindgenUnionField { @@ -58,7 +56,6 @@ pub struct TErrorResult { pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState = TErrorResult_UnionState::HasMessage; #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum TErrorResult_UnionState { HasMessage = 0, diff --git a/tests/expectations/tests/bitfield_align_2.rs b/tests/expectations/tests/bitfield_align_2.rs index 5174d1aabc..5d63699d48 100644 --- a/tests/expectations/tests/bitfield_align_2.rs +++ b/tests/expectations/tests/bitfield_align_2.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit @@ -84,7 +82,6 @@ where } } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum MyEnum { ONE = 0, diff --git a/tests/expectations/tests/class_with_inner_struct.rs b/tests/expectations/tests/class_with_inner_struct.rs index f656012584..265d7c5bfc 100644 --- a/tests/expectations/tests/class_with_inner_struct.rs +++ b/tests/expectations/tests/class_with_inner_struct.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Copy, Clone)] pub struct A { @@ -214,7 +212,6 @@ fn bindgen_test_layout_B() { ); } #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StepSyntax { Keyword = 0, diff --git a/tests/expectations/tests/class_with_inner_struct_1_0.rs b/tests/expectations/tests/class_with_inner_struct_1_0.rs index e807236232..a2c01b4e65 100644 --- a/tests/expectations/tests/class_with_inner_struct_1_0.rs +++ b/tests/expectations/tests/class_with_inner_struct_1_0.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] pub struct __BindgenUnionField(::std::marker::PhantomData); impl __BindgenUnionField { @@ -272,7 +270,6 @@ impl Clone for B { } } #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StepSyntax { Keyword = 0, diff --git a/tests/expectations/tests/const_enum_unnamed.rs b/tests/expectations/tests/const_enum_unnamed.rs index 833f835172..6b04c7dd4c 100644 --- a/tests/expectations/tests/const_enum_unnamed.rs +++ b/tests/expectations/tests/const_enum_unnamed.rs @@ -1,13 +1,10 @@ /* automatically generated by rust-bindgen */ - #![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; pub const FOO_BAZ: _bindgen_ty_1 = _bindgen_ty_1::FOO_BAZ; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { FOO_BAR = 0, @@ -20,7 +17,6 @@ pub struct Foo { } pub const Foo_FOO_BAR: Foo__bindgen_ty_1 = Foo__bindgen_ty_1::FOO_BAR; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo__bindgen_ty_1 { FOO_BAR = 10, diff --git a/tests/expectations/tests/constify-enum.rs b/tests/expectations/tests/constify-enum.rs index 79fc4dff31..dd46e08514 100644 --- a/tests/expectations/tests/constify-enum.rs +++ b/tests/expectations/tests/constify-enum.rs @@ -1,15 +1,12 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - pub const nsCSSPropertyID_eCSSProperty_COUNT_unexistingVariantValue: nsCSSPropertyID = nsCSSPropertyID::eCSSProperty_COUNT_unexistingVariantValue; pub const nsCSSPropertyID_eCSSProperty_COUNT: nsCSSPropertyID = nsCSSPropertyID::eCSSPropertyAlias_aa; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsCSSPropertyID { eCSSProperty_a = 0, diff --git a/tests/expectations/tests/empty-enum.rs b/tests/expectations/tests/empty-enum.rs index 4ec7df8a63..99ffc27ede 100644 --- a/tests/expectations/tests/empty-enum.rs +++ b/tests/expectations/tests/empty-enum.rs @@ -1,12 +1,9 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - pub type EmptyConstified = ::std::os::raw::c_uint; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum EmptyRustified { __bindgen_cannot_repr_c_on_empty_enum = 0, @@ -15,7 +12,6 @@ pub mod EmptyModule { pub type Type = ::std::os::raw::c_uint; } #[repr(i8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum EmptyClassRustified { __bindgen_cannot_repr_c_on_empty_enum = 0, @@ -25,7 +21,6 @@ pub mod EmptyClassModule { pub type Type = ::std::os::raw::c_char; } #[repr(i8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum ForwardClassRustified { __bindgen_cannot_repr_c_on_empty_enum = 0, diff --git a/tests/expectations/tests/enum.rs b/tests/expectations/tests/enum.rs index b1920aaef0..2ed5d18778 100644 --- a/tests/expectations/tests/enum.rs +++ b/tests/expectations/tests/enum.rs @@ -1,18 +1,14 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo { Bar = 0, Qux = 1, } #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Neg { MinusOne = -1, diff --git a/tests/expectations/tests/enum_alias.rs b/tests/expectations/tests/enum_alias.rs index cde429f762..30a4f62a8d 100644 --- a/tests/expectations/tests/enum_alias.rs +++ b/tests/expectations/tests/enum_alias.rs @@ -1,11 +1,8 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(u8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Bar { VAL = 0, diff --git a/tests/expectations/tests/enum_and_vtable_mangling.rs b/tests/expectations/tests/enum_and_vtable_mangling.rs index 42ee383214..76e28aaf70 100644 --- a/tests/expectations/tests/enum_and_vtable_mangling.rs +++ b/tests/expectations/tests/enum_and_vtable_mangling.rs @@ -1,13 +1,10 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - pub const match_: _bindgen_ty_1 = _bindgen_ty_1::match_; pub const whatever_else: _bindgen_ty_1 = _bindgen_ty_1::whatever_else; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { match_ = 0, diff --git a/tests/expectations/tests/enum_dupe.rs b/tests/expectations/tests/enum_dupe.rs index 151b2cd027..29bd7502a4 100644 --- a/tests/expectations/tests/enum_dupe.rs +++ b/tests/expectations/tests/enum_dupe.rs @@ -1,12 +1,9 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - pub const Foo_Dupe: Foo = Foo::Bar; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo { Bar = 1, diff --git a/tests/expectations/tests/enum_explicit_type.rs b/tests/expectations/tests/enum_explicit_type.rs index 644a1cea41..17f135b3af 100644 --- a/tests/expectations/tests/enum_explicit_type.rs +++ b/tests/expectations/tests/enum_explicit_type.rs @@ -1,44 +1,36 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(u8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo { Bar = 0, Qux = 1, } #[repr(i8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Neg { MinusOne = -1, One = 1, } #[repr(u16)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Bigger { Much = 255, Larger = 256, } #[repr(i64)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum MuchLong { MuchLow = -4294967296, } #[repr(i64)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum MuchLongLong { I64_MIN = -9223372036854775808, } #[repr(u64)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum MuchULongLong { MuchHigh = 4294967296, diff --git a/tests/expectations/tests/enum_in_template_with_typedef.rs b/tests/expectations/tests/enum_in_template_with_typedef.rs index 588bb42b9e..a3b4e7762f 100644 --- a/tests/expectations/tests/enum_in_template_with_typedef.rs +++ b/tests/expectations/tests/enum_in_template_with_typedef.rs @@ -1,9 +1,7 @@ /* 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 std_fbstring_core { @@ -13,7 +11,6 @@ pub type std_fbstring_core_category_type = u8; pub const std_fbstring_core_Category_Bar: std_fbstring_core_Category = std_fbstring_core_Category::Foo; #[repr(u8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum std_fbstring_core_Category { Foo = 0, diff --git a/tests/expectations/tests/enum_negative.rs b/tests/expectations/tests/enum_negative.rs index 1fe2f6a4ba..e066968db4 100644 --- a/tests/expectations/tests/enum_negative.rs +++ b/tests/expectations/tests/enum_negative.rs @@ -1,11 +1,8 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo { Bar = -2, diff --git a/tests/expectations/tests/enum_packed.rs b/tests/expectations/tests/enum_packed.rs index d8e96b0ffb..d388b5edc0 100644 --- a/tests/expectations/tests/enum_packed.rs +++ b/tests/expectations/tests/enum_packed.rs @@ -1,25 +1,20 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(u8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo { Bar = 0, Qux = 1, } #[repr(i8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Neg { MinusOne = -1, One = 1, } #[repr(u16)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Bigger { Much = 255, diff --git a/tests/expectations/tests/forward-enum-decl.rs b/tests/expectations/tests/forward-enum-decl.rs index c2dea97aeb..d327cb725b 100644 --- a/tests/expectations/tests/forward-enum-decl.rs +++ b/tests/expectations/tests/forward-enum-decl.rs @@ -1,11 +1,8 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum CSSPseudoClassType { empty = 0, diff --git a/tests/expectations/tests/func_ptr_in_struct.rs b/tests/expectations/tests/func_ptr_in_struct.rs index 33d908e20e..d66ce84d1d 100644 --- a/tests/expectations/tests/func_ptr_in_struct.rs +++ b/tests/expectations/tests/func_ptr_in_struct.rs @@ -1,11 +1,8 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum baz { __bindgen_cannot_repr_c_on_empty_enum = 0, diff --git a/tests/expectations/tests/issue-372.rs b/tests/expectations/tests/issue-372.rs index f9040a9982..a146573bb4 100644 --- a/tests/expectations/tests/issue-372.rs +++ b/tests/expectations/tests/issue-372.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![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)] pub mod root { #[allow(unused_imports)] @@ -77,7 +75,6 @@ pub mod root { } } #[repr(u32)] - #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum n { o = 0, diff --git a/tests/expectations/tests/issue-410.rs b/tests/expectations/tests/issue-410.rs index f23462bf6c..e1ce9df549 100644 --- a/tests/expectations/tests/issue-410.rs +++ b/tests/expectations/tests/issue-410.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![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)] pub mod root { #[allow(unused_imports)] @@ -41,7 +39,6 @@ pub mod root { } } #[repr(u32)] - #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSWhyMagic { __bindgen_cannot_repr_c_on_empty_enum = 0, diff --git a/tests/expectations/tests/issue-493.rs b/tests/expectations/tests/issue-493.rs index d338e30cf3..69003faffa 100644 --- a/tests/expectations/tests/issue-493.rs +++ b/tests/expectations/tests/issue-493.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] pub struct __BindgenUnionField(::std::marker::PhantomData); impl __BindgenUnionField { @@ -70,7 +68,6 @@ impl Default for basic_string___long { pub const basic_string___min_cap: basic_string__bindgen_ty_1 = basic_string__bindgen_ty_1::__min_cap; #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum basic_string__bindgen_ty_1 { __min_cap = 0, @@ -110,7 +107,6 @@ impl Default for basic_string___ulx { pub const basic_string___n_words: basic_string__bindgen_ty_2 = basic_string__bindgen_ty_2::__n_words; #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum basic_string__bindgen_ty_2 { __n_words = 0, diff --git a/tests/expectations/tests/issue-493_1_0.rs b/tests/expectations/tests/issue-493_1_0.rs index 4dfc26d8d6..a65cd3e846 100644 --- a/tests/expectations/tests/issue-493_1_0.rs +++ b/tests/expectations/tests/issue-493_1_0.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] pub struct __BindgenUnionField(::std::marker::PhantomData); impl __BindgenUnionField { @@ -70,7 +68,6 @@ impl Default for basic_string___long { pub const basic_string___min_cap: basic_string__bindgen_ty_1 = basic_string__bindgen_ty_1::__min_cap; #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum basic_string__bindgen_ty_1 { __min_cap = 0, @@ -108,7 +105,6 @@ impl Default for basic_string___ulx { pub const basic_string___n_words: basic_string__bindgen_ty_2 = basic_string__bindgen_ty_2::__n_words; #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum basic_string__bindgen_ty_2 { __n_words = 0, 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 3029a67032..1119b7e76a 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,13 +1,10 @@ /* automatically generated by rust-bindgen */ - #![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; pub const ENUM_VARIANT_2: _bindgen_ty_1 = _bindgen_ty_1::ENUM_VARIANT_2; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { ENUM_VARIANT_1 = 0, diff --git a/tests/expectations/tests/issue-888-enum-var-decl-jump.rs b/tests/expectations/tests/issue-888-enum-var-decl-jump.rs index c0ac112d18..df48ae24a5 100644 --- a/tests/expectations/tests/issue-888-enum-var-decl-jump.rs +++ b/tests/expectations/tests/issue-888-enum-var-decl-jump.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![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)] pub mod root { #[allow(unused_imports)] @@ -35,7 +33,6 @@ pub mod root { } } #[repr(u32)] - #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum a { __bindgen_cannot_repr_c_on_empty_enum = 0, diff --git a/tests/expectations/tests/jsval_layout_opaque.rs b/tests/expectations/tests/jsval_layout_opaque.rs index 2b2d0d77f9..fa4999caf1 100644 --- a/tests/expectations/tests/jsval_layout_opaque.rs +++ b/tests/expectations/tests/jsval_layout_opaque.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit @@ -87,7 +85,6 @@ pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47; pub const JSVAL_PAYLOAD_MASK: ::std::os::raw::c_ulonglong = 140737488355327; pub const JSVAL_TAG_MASK: ::std::os::raw::c_longlong = -140737488355328; #[repr(u8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSValueType { JSVAL_TYPE_DOUBLE = 0, @@ -103,7 +100,6 @@ pub enum JSValueType { JSVAL_TYPE_MISSING = 33, } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSValueTag { JSVAL_TAG_MAX_DOUBLE = 131056, @@ -117,7 +113,6 @@ pub enum JSValueTag { JSVAL_TAG_OBJECT = 131064, } #[repr(u64)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSValueShiftedTag { JSVAL_SHIFTED_TAG_MAX_DOUBLE = 18444492278190833663, @@ -131,7 +126,6 @@ pub enum JSValueShiftedTag { JSVAL_SHIFTED_TAG_OBJECT = 18445618173802708992, } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSWhyMagic { JS_ELEMENTS_HOLE = 0, diff --git a/tests/expectations/tests/jsval_layout_opaque_1_0.rs b/tests/expectations/tests/jsval_layout_opaque_1_0.rs index ab11a23165..dc41c49cc7 100644 --- a/tests/expectations/tests/jsval_layout_opaque_1_0.rs +++ b/tests/expectations/tests/jsval_layout_opaque_1_0.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit @@ -130,7 +128,6 @@ pub const JSVAL_TAG_SHIFT: ::std::os::raw::c_uint = 47; pub const JSVAL_PAYLOAD_MASK: ::std::os::raw::c_ulonglong = 140737488355327; pub const JSVAL_TAG_MASK: ::std::os::raw::c_longlong = -140737488355328; #[repr(u8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSValueType { JSVAL_TYPE_DOUBLE = 0, @@ -146,7 +143,6 @@ pub enum JSValueType { JSVAL_TYPE_MISSING = 33, } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSValueTag { JSVAL_TAG_MAX_DOUBLE = 131056, @@ -160,7 +156,6 @@ pub enum JSValueTag { JSVAL_TAG_OBJECT = 131064, } #[repr(u64)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSValueShiftedTag { JSVAL_SHIFTED_TAG_MAX_DOUBLE = 18444492278190833663, @@ -174,7 +169,6 @@ pub enum JSValueShiftedTag { JSVAL_SHIFTED_TAG_OBJECT = 18445618173802708992, } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum JSWhyMagic { JS_ELEMENTS_HOLE = 0, diff --git a/tests/expectations/tests/layout_array_too_long.rs b/tests/expectations/tests/layout_array_too_long.rs index 59884451b8..bb98704f32 100644 --- a/tests/expectations/tests/layout_array_too_long.rs +++ b/tests/expectations/tests/layout_array_too_long.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![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; pub const RTE_LIBRTE_IP_FRAG_MAX_FRAG: ::std::os::raw::c_uint = 4; pub const IP_LAST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_LAST_FRAG_IDX; @@ -11,7 +9,6 @@ pub const IP_FIRST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_FIRST_FRAG_IDX; pub const IP_MIN_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MIN_FRAG_NUM; pub const IP_MAX_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MAX_FRAG_NUM; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { IP_LAST_FRAG_IDX = 0, diff --git a/tests/expectations/tests/layout_cmdline_token.rs b/tests/expectations/tests/layout_cmdline_token.rs index 2cde7c42cf..d583e641dc 100644 --- a/tests/expectations/tests/layout_cmdline_token.rs +++ b/tests/expectations/tests/layout_cmdline_token.rs @@ -1,10 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - - /// Stores a pointer to the ops struct, and the offset: the place to /// write the parsed result in the destination structure. #[repr(C)] @@ -166,7 +163,6 @@ impl Default for cmdline_token_ops { } } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum cmdline_numtype { UINT8 = 0, diff --git a/tests/expectations/tests/layout_eth_conf.rs b/tests/expectations/tests/layout_eth_conf.rs index 599f9788fe..176e0d5551 100644 --- a/tests/expectations/tests/layout_eth_conf.rs +++ b/tests/expectations/tests/layout_eth_conf.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit @@ -116,7 +114,6 @@ pub const RTE_ETH_FLOW_GENEVE: ::std::os::raw::c_uint = 20; pub const RTE_ETH_FLOW_NVGRE: ::std::os::raw::c_uint = 21; pub const RTE_ETH_FLOW_MAX: ::std::os::raw::c_uint = 22; #[repr(u32)] -#[repr(C)] /// A set of values to identify what method is to be used to route /// packets to multiple queues. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -344,7 +341,6 @@ impl rte_eth_rxmode { } } #[repr(u32)] -#[repr(C)] /// A set of values to identify what method is to be used to transmit /// packets using multi-TCs. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -534,7 +530,6 @@ impl Default for rte_eth_rss_conf { } } #[repr(u32)] -#[repr(C)] /// This enum indicates the possible number of traffic classes /// in DCB configratioins #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -543,7 +538,6 @@ pub enum rte_eth_nb_tcs { ETH_8_TCS = 8, } #[repr(u32)] -#[repr(C)] /// This enum indicates the possible number of queue pools /// in VMDQ configurations. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1058,7 +1052,6 @@ impl Default for rte_eth_vmdq_rx_conf { } } #[repr(u32)] -#[repr(C)] /// Flow Director setting modes: none, signature or perfect. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum rte_fdir_mode { @@ -1069,7 +1062,6 @@ pub enum rte_fdir_mode { RTE_FDIR_MODE_PERFECT_TUNNEL = 4, } #[repr(u32)] -#[repr(C)] /// Memory space that can be configured to store Flow Director filters /// in the board memory. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1079,7 +1071,6 @@ pub enum rte_fdir_pballoc_type { RTE_FDIR_PBALLOC_256K = 2, } #[repr(u32)] -#[repr(C)] /// Select report mode of FDIR hash information in RX descriptors. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum rte_fdir_status_mode { @@ -1373,7 +1364,6 @@ fn bindgen_test_layout_rte_eth_fdir_masks() { ); } #[repr(u32)] -#[repr(C)] /// Payload type #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum rte_eth_payload_type { diff --git a/tests/expectations/tests/layout_eth_conf_1_0.rs b/tests/expectations/tests/layout_eth_conf_1_0.rs index 532fcae8e1..8323460a7d 100644 --- a/tests/expectations/tests/layout_eth_conf_1_0.rs +++ b/tests/expectations/tests/layout_eth_conf_1_0.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit @@ -159,7 +157,6 @@ pub const RTE_ETH_FLOW_GENEVE: ::std::os::raw::c_uint = 20; pub const RTE_ETH_FLOW_NVGRE: ::std::os::raw::c_uint = 21; pub const RTE_ETH_FLOW_MAX: ::std::os::raw::c_uint = 22; #[repr(u32)] -#[repr(C)] /// A set of values to identify what method is to be used to route /// packets to multiple queues. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -392,7 +389,6 @@ impl rte_eth_rxmode { } } #[repr(u32)] -#[repr(C)] /// A set of values to identify what method is to be used to transmit /// packets using multi-TCs. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -592,7 +588,6 @@ impl Default for rte_eth_rss_conf { } } #[repr(u32)] -#[repr(C)] /// This enum indicates the possible number of traffic classes /// in DCB configratioins #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -601,7 +596,6 @@ pub enum rte_eth_nb_tcs { ETH_8_TCS = 8, } #[repr(u32)] -#[repr(C)] /// This enum indicates the possible number of queue pools /// in VMDQ configurations. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1156,7 +1150,6 @@ impl Default for rte_eth_vmdq_rx_conf { } } #[repr(u32)] -#[repr(C)] /// Flow Director setting modes: none, signature or perfect. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum rte_fdir_mode { @@ -1167,7 +1160,6 @@ pub enum rte_fdir_mode { RTE_FDIR_MODE_PERFECT_TUNNEL = 4, } #[repr(u32)] -#[repr(C)] /// Memory space that can be configured to store Flow Director filters /// in the board memory. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -1177,7 +1169,6 @@ pub enum rte_fdir_pballoc_type { RTE_FDIR_PBALLOC_256K = 2, } #[repr(u32)] -#[repr(C)] /// Select report mode of FDIR hash information in RX descriptors. #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum rte_fdir_status_mode { @@ -1486,7 +1477,6 @@ impl Clone for rte_eth_fdir_masks { } } #[repr(u32)] -#[repr(C)] /// Payload type #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum rte_eth_payload_type { diff --git a/tests/expectations/tests/layout_large_align_field.rs b/tests/expectations/tests/layout_large_align_field.rs index 501e1bcec7..cbe84e3bcd 100644 --- a/tests/expectations/tests/layout_large_align_field.rs +++ b/tests/expectations/tests/layout_large_align_field.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Default)] pub struct __IncompleteArrayField(::std::marker::PhantomData); @@ -48,7 +46,6 @@ pub const IP_FIRST_FRAG_IDX: _bindgen_ty_1 = _bindgen_ty_1::IP_FIRST_FRAG_IDX; pub const IP_MIN_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MIN_FRAG_NUM; pub const IP_MAX_FRAG_NUM: _bindgen_ty_1 = _bindgen_ty_1::IP_MAX_FRAG_NUM; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { IP_LAST_FRAG_IDX = 0, diff --git a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs index 1b6aca15b5..8faddfe969 100644 --- a/tests/expectations/tests/libclang-3.8/constant-evaluate.rs +++ b/tests/expectations/tests/libclang-3.8/constant-evaluate.rs @@ -7,7 +7,6 @@ pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo; pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { foo = 4, bar = 8, } pub type EasyToOverflow = ::std::os::raw::c_ulonglong; diff --git a/tests/expectations/tests/libclang-3.9/constant-evaluate.rs b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs index 76cbf24edf..096bc1822f 100644 --- a/tests/expectations/tests/libclang-3.9/constant-evaluate.rs +++ b/tests/expectations/tests/libclang-3.9/constant-evaluate.rs @@ -7,7 +7,6 @@ pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo; pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { foo = 4, diff --git a/tests/expectations/tests/libclang-4/constant-evaluate.rs b/tests/expectations/tests/libclang-4/constant-evaluate.rs index 76cbf24edf..51365df584 100644 --- a/tests/expectations/tests/libclang-4/constant-evaluate.rs +++ b/tests/expectations/tests/libclang-4/constant-evaluate.rs @@ -1,13 +1,10 @@ /* 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)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_1 { foo = 4, diff --git a/tests/expectations/tests/nsStyleAutoArray.rs b/tests/expectations/tests/nsStyleAutoArray.rs index 199222ecb7..bd5e7f4b83 100644 --- a/tests/expectations/tests/nsStyleAutoArray.rs +++ b/tests/expectations/tests/nsStyleAutoArray.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nsTArray { @@ -23,7 +21,6 @@ pub struct nsStyleAutoArray { pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell>, } #[repr(i32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsStyleAutoArray_WithSingleInitialElement { WITH_SINGLE_INITIAL_ELEMENT = 0, diff --git a/tests/expectations/tests/overflowed_enum.rs b/tests/expectations/tests/overflowed_enum.rs index 9104867d52..25e9178601 100644 --- a/tests/expectations/tests/overflowed_enum.rs +++ b/tests/expectations/tests/overflowed_enum.rs @@ -1,11 +1,8 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Foo { BAP_ARM = 9698489, @@ -13,7 +10,6 @@ pub enum Foo { BAP_X86_64 = 3128633167, } #[repr(u16)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Bar { One = 1, diff --git a/tests/expectations/tests/prepend-enum-constified-variant.rs b/tests/expectations/tests/prepend-enum-constified-variant.rs index afe2c0b1f8..7f3b674669 100644 --- a/tests/expectations/tests/prepend-enum-constified-variant.rs +++ b/tests/expectations/tests/prepend-enum-constified-variant.rs @@ -1,12 +1,9 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - pub const AV_CODEC_ID_TTF: AVCodecID = AVCodecID::AV_CODEC_ID_FIRST_UNKNOWN; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum AVCodecID { AV_CODEC_ID_FIRST_UNKNOWN = 98304, diff --git a/tests/expectations/tests/short-enums.rs b/tests/expectations/tests/short-enums.rs index 882b368c63..a7739f21ec 100644 --- a/tests/expectations/tests/short-enums.rs +++ b/tests/expectations/tests/short-enums.rs @@ -1,23 +1,18 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(u8)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum one_byte_t { SOME_VALUE = 1, } #[repr(u16)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum two_byte_t { SOME_OTHER_VALUE = 256, } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum four_byte_t { SOME_BIGGER_VALUE = 16777216, diff --git a/tests/expectations/tests/struct_typedef.rs b/tests/expectations/tests/struct_typedef.rs index 0e6151441e..f85aeb4c09 100644 --- a/tests/expectations/tests/struct_typedef.rs +++ b/tests/expectations/tests/struct_typedef.rs @@ -1,9 +1,7 @@ /* 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, Hash, PartialEq, Eq)] pub struct typedef_named_struct { @@ -68,14 +66,12 @@ impl Default for _bindgen_ty_1 { pub type struct_ptr_t = *mut _bindgen_ty_1; pub type struct_ptr_ptr_t = *mut *mut _bindgen_ty_1; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum typedef_named_enum { ENUM_HAS_NAME = 1, } pub const ENUM_IS_ANON: _bindgen_ty_2 = _bindgen_ty_2::ENUM_IS_ANON; #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_2 { ENUM_IS_ANON = 0, diff --git a/tests/expectations/tests/struct_typedef_ns.rs b/tests/expectations/tests/struct_typedef_ns.rs index cbbdaa7b91..79fa38de43 100644 --- a/tests/expectations/tests/struct_typedef_ns.rs +++ b/tests/expectations/tests/struct_typedef_ns.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![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)] pub mod root { #[allow(unused_imports)] @@ -40,7 +38,6 @@ pub mod root { ); } #[repr(u32)] - #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum typedef_enum { BAR = 1, @@ -81,7 +78,6 @@ pub mod root { pub const _bindgen_mod_id_12_BAR: root::_bindgen_mod_id_12::_bindgen_ty_2 = _bindgen_ty_2::BAR; #[repr(u32)] - #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum _bindgen_ty_2 { BAR = 1, diff --git a/tests/expectations/tests/weird_bitfields.rs b/tests/expectations/tests/weird_bitfields.rs index 22cd8ea5ac..8ab2987cf6 100644 --- a/tests/expectations/tests/weird_bitfields.rs +++ b/tests/expectations/tests/weird_bitfields.rs @@ -1,9 +1,7 @@ /* automatically generated by rust-bindgen */ - #![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] - #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit @@ -84,7 +82,6 @@ where } } #[repr(u32)] -#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum nsStyleSVGOpacitySource { eStyleSVGOpacitySource_Normal = 0,