Skip to content

Commit 46781fd

Browse files
committed
Updated test expectations now that we are inferring template parameter usage
1 parent 0453a64 commit 46781fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+444
-447
lines changed

tests/expectations/tests/381-decltype-alias.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct std_allocator_traits<_Alloc> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct std_allocator_traits {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<_Alloc>,
12-
}
13-
impl <_Alloc> Default for std_allocator_traits<_Alloc> {
14-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1511
}
12+
pub type std_allocator_traits___size_type<_Alloc> = _Alloc;

tests/expectations/tests/anon_enum_trait.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct DataType<_Tp> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct DataType {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<_Tp>,
1211
}
1312
pub type DataType_value_type<_Tp> = _Tp;
1413
pub type DataType_work_type<_Tp> = DataType_value_type<_Tp>;
@@ -27,9 +26,6 @@ pub const DataType_type_: DataType__bindgen_ty_1 =
2726
#[repr(i32)]
2827
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2928
pub enum DataType__bindgen_ty_1 { generic_type = 0, }
30-
impl <_Tp> Default for DataType<_Tp> {
31-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
32-
}
3329
#[repr(C)]
3430
#[derive(Debug, Default, Copy)]
3531
pub struct Foo {

tests/expectations/tests/anon_union.rs

+9-24
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ impl <T> ::std::fmt::Debug for __BindgenUnionField<T> {
3030
}
3131
#[repr(C)]
3232
#[derive(Debug, Copy, Clone)]
33-
pub struct TErrorResult<T> {
33+
pub struct TErrorResult {
3434
pub mResult: ::std::os::raw::c_int,
35-
pub __bindgen_anon_1: TErrorResult__bindgen_ty_1<T>,
35+
pub __bindgen_anon_1: TErrorResult__bindgen_ty_1,
3636
pub mMightHaveUnreported: bool,
3737
pub mUnionState: TErrorResult_UnionState,
38-
pub _phantom_0: ::std::marker::PhantomData<T>,
3938
}
4039
pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState =
4140
TErrorResult_UnionState::HasMessage;
@@ -44,31 +43,28 @@ pub const TErrorResult_UnionState_HasException: TErrorResult_UnionState =
4443
pub enum TErrorResult_UnionState { HasMessage = 0, }
4544
#[repr(C)]
4645
#[derive(Debug, Default, Copy, Clone)]
47-
pub struct TErrorResult_Message<T> {
46+
pub struct TErrorResult_Message {
4847
pub _address: u8,
49-
pub _phantom_0: ::std::marker::PhantomData<T>,
5048
}
5149
#[repr(C)]
5250
#[derive(Debug, Default, Copy, Clone)]
53-
pub struct TErrorResult_DOMExceptionInfo<T> {
51+
pub struct TErrorResult_DOMExceptionInfo {
5452
pub _address: u8,
55-
pub _phantom_0: ::std::marker::PhantomData<T>,
5653
}
5754
#[repr(C)]
5855
#[derive(Debug, Default, Copy, Clone)]
59-
pub struct TErrorResult__bindgen_ty_1<T> {
60-
pub mMessage: __BindgenUnionField<*mut TErrorResult_Message<T>>,
61-
pub mDOMExceptionInfo: __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo<T>>,
56+
pub struct TErrorResult__bindgen_ty_1 {
57+
pub mMessage: __BindgenUnionField<*mut TErrorResult_Message>,
58+
pub mDOMExceptionInfo: __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo>,
6259
pub bindgen_union_field: u64,
63-
pub _phantom_0: ::std::marker::PhantomData<T>,
6460
}
65-
impl <T> Default for TErrorResult<T> {
61+
impl Default for TErrorResult {
6662
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
6763
}
6864
#[repr(C)]
6965
#[derive(Debug, Copy)]
7066
pub struct ErrorResult {
71-
pub _base: TErrorResult<::std::os::raw::c_int>,
67+
pub _base: TErrorResult,
7268
}
7369
#[test]
7470
fn bindgen_test_layout_ErrorResult() {
@@ -83,14 +79,3 @@ impl Clone for ErrorResult {
8379
impl Default for ErrorResult {
8480
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
8581
}
86-
#[test]
87-
fn __bindgen_test_layout_template_1() {
88-
assert_eq!(::std::mem::size_of::<TErrorResult<::std::os::raw::c_int>>() ,
89-
24usize , concat ! (
90-
"Size of template specialization: " , stringify ! (
91-
TErrorResult<::std::os::raw::c_int> ) ));
92-
assert_eq!(::std::mem::align_of::<TErrorResult<::std::os::raw::c_int>>() ,
93-
8usize , concat ! (
94-
"Alignment of template specialization: " , stringify ! (
95-
TErrorResult<::std::os::raw::c_int> ) ));
96-
}

tests/expectations/tests/auto.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ impl Clone for Foo {
2121
fn clone(&self) -> Self { *self }
2222
}
2323
#[repr(C)]
24-
#[derive(Debug, Copy, Clone)]
25-
pub struct Bar<T> {
24+
#[derive(Debug, Default, Copy, Clone)]
25+
pub struct Bar {
2626
pub _address: u8,
27-
pub _phantom_0: ::std::marker::PhantomData<T>,
28-
}
29-
impl <T> Default for Bar<T> {
30-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
3127
}
3228
extern "C" {
3329
#[link_name = "_Z5Test2v"]

tests/expectations/tests/bad-namespace-parenthood-inheritance.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct std_char_traits<_CharT> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct std_char_traits {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<_CharT>,
12-
}
13-
impl <_CharT> Default for std_char_traits<_CharT> {
14-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1511
}
1612
#[repr(C)]
1713
#[derive(Debug, Default, Copy)]

tests/expectations/tests/class_nested.rs

-11
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,6 @@ extern "C" {
7676
#[link_name = "var"]
7777
pub static mut var: A_B;
7878
}
79-
#[test]
80-
fn __bindgen_test_layout_template_1() {
81-
assert_eq!(::std::mem::size_of::<A_D<::std::os::raw::c_int>>() , 4usize ,
82-
concat ! (
83-
"Size of template specialization: " , stringify ! (
84-
A_D<::std::os::raw::c_int> ) ));
85-
assert_eq!(::std::mem::align_of::<A_D<::std::os::raw::c_int>>() , 4usize ,
86-
concat ! (
87-
"Alignment of template specialization: " , stringify ! (
88-
A_D<::std::os::raw::c_int> ) ));
89-
}
9079
extern "C" {
9180
#[link_name = "baz"]
9281
pub static mut baz: A_D<::std::os::raw::c_int>;

tests/expectations/tests/class_with_dtor.rs

-11
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,3 @@ fn bindgen_test_layout_WithoutDtor() {
3333
impl Default for WithoutDtor {
3434
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
3535
}
36-
#[test]
37-
fn __bindgen_test_layout_template_1() {
38-
assert_eq!(::std::mem::size_of::<HandleWithDtor<::std::os::raw::c_int>>()
39-
, 8usize , concat ! (
40-
"Size of template specialization: " , stringify ! (
41-
HandleWithDtor<::std::os::raw::c_int> ) ));
42-
assert_eq!(::std::mem::align_of::<HandleWithDtor<::std::os::raw::c_int>>()
43-
, 8usize , concat ! (
44-
"Alignment of template specialization: " , stringify ! (
45-
HandleWithDtor<::std::os::raw::c_int> ) ));
46-
}

tests/expectations/tests/constant-non-specialized-tp.rs

+5-14
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,17 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct Test<Args> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct Test {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<Args>,
12-
}
13-
impl <Args> Default for Test<Args> {
14-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1511
}
1612
#[repr(C)]
17-
#[derive(Debug, Copy, Clone)]
18-
pub struct Outer<T> {
13+
#[derive(Debug, Default, Copy, Clone)]
14+
pub struct Outer {
1915
pub _address: u8,
20-
pub _phantom_0: ::std::marker::PhantomData<T>,
2116
}
2217
#[repr(C)]
2318
#[derive(Debug, Default, Copy, Clone)]
24-
pub struct Outer_Inner<T> {
19+
pub struct Outer_Inner {
2520
pub _address: u8,
26-
pub _phantom_0: ::std::marker::PhantomData<T>,
27-
}
28-
impl <T> Default for Outer<T> {
29-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
3021
}

tests/expectations/tests/constructor-tp.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct Foo<T> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct Foo {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<T>,
12-
}
13-
impl <T> Default for Foo<T> {
14-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1511
}
1612
#[repr(C)]
1713
#[derive(Debug, Default, Copy)]

tests/expectations/tests/crtp.rs

+4-32
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct Base<T> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct Base {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<T>,
12-
}
13-
impl <T> Default for Base<T> {
14-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1511
}
1612
#[repr(C)]
1713
#[derive(Debug, Copy)]
@@ -32,13 +28,9 @@ impl Default for Derived {
3228
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
3329
}
3430
#[repr(C)]
35-
#[derive(Debug)]
36-
pub struct BaseWithDestructor<T> {
31+
#[derive(Debug, Default)]
32+
pub struct BaseWithDestructor {
3733
pub _address: u8,
38-
pub _phantom_0: ::std::marker::PhantomData<T>,
39-
}
40-
impl <T> Default for BaseWithDestructor<T> {
41-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
4234
}
4335
#[repr(C)]
4436
#[derive(Debug)]
@@ -58,23 +50,3 @@ fn bindgen_test_layout_DerivedFromBaseWithDestructor() {
5850
impl Default for DerivedFromBaseWithDestructor {
5951
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
6052
}
61-
#[test]
62-
fn __bindgen_test_layout_template_1() {
63-
assert_eq!(::std::mem::size_of::<Base<Derived>>() , 1usize , concat ! (
64-
"Size of template specialization: " , stringify ! (
65-
Base<Derived> ) ));
66-
assert_eq!(::std::mem::align_of::<Base<Derived>>() , 1usize , concat ! (
67-
"Alignment of template specialization: " , stringify ! (
68-
Base<Derived> ) ));
69-
}
70-
#[test]
71-
fn __bindgen_test_layout_template_2() {
72-
assert_eq!(::std::mem::size_of::<BaseWithDestructor<DerivedFromBaseWithDestructor>>()
73-
, 1usize , concat ! (
74-
"Size of template specialization: " , stringify ! (
75-
BaseWithDestructor<DerivedFromBaseWithDestructor> ) ));
76-
assert_eq!(::std::mem::align_of::<BaseWithDestructor<DerivedFromBaseWithDestructor>>()
77-
, 1usize , concat ! (
78-
"Alignment of template specialization: " , stringify ! (
79-
BaseWithDestructor<DerivedFromBaseWithDestructor> ) ));
80-
}

tests/expectations/tests/dash_language.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct Foo<T> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct Foo {
1010
pub bar: ::std::os::raw::c_int,
11-
pub _phantom_0: ::std::marker::PhantomData<T>,
12-
}
13-
impl <T> Default for Foo<T> {
14-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1511
}

tests/expectations/tests/empty_template_param_name.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66

77
pub type __void_t = ::std::os::raw::c_void;
88
#[repr(C)]
9-
#[derive(Debug, Copy, Clone)]
10-
pub struct __iterator_traits<_Iterator> {
9+
#[derive(Debug, Default, Copy, Clone)]
10+
pub struct __iterator_traits {
1111
pub _address: u8,
12-
pub _phantom_0: ::std::marker::PhantomData<_Iterator>,
13-
}
14-
impl <_Iterator> Default for __iterator_traits<_Iterator> {
15-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1612
}

tests/expectations/tests/enum_in_template_with_typedef.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct std_fbstring_core<Char> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct std_fbstring_core {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<Char>,
1211
}
1312
pub type std_fbstring_core_category_type = u8;
1413
pub const std_fbstring_core_Category_Bar: std_fbstring_core_Category =
1514
std_fbstring_core_Category::Foo;
1615
#[repr(u8)]
1716
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1817
pub enum std_fbstring_core_Category { Foo = 0, }
19-
impl <Char> Default for std_fbstring_core<Char> {
20-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
21-
}

tests/expectations/tests/eval-variadic-template-parameter.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct B<T> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct B {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<T>,
12-
}
13-
impl <T> Default for B<T> {
14-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1511
}

tests/expectations/tests/forward-inherit-struct.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66

77
#[repr(C)]
88
#[derive(Debug, Copy, Clone)]
9-
pub struct Rooted<T> {
9+
pub struct Rooted {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<T>,
1211
}
13-
impl <T> Default for Rooted<T> {
12+
impl Default for Rooted {
1413
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
1514
}
1615
#[repr(C)]
17-
#[derive(Debug, Copy, Clone)]
18-
pub struct js_RootedBase<T> {
16+
#[derive(Debug, Default, Copy, Clone)]
17+
pub struct js_RootedBase {
1918
pub _address: u8,
20-
pub _phantom_0: ::std::marker::PhantomData<T>,
21-
}
22-
impl <T> Default for js_RootedBase<T> {
23-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
2419
}

tests/expectations/tests/in_class_typedef.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,15 @@
55

66

77
#[repr(C)]
8-
#[derive(Debug, Copy, Clone)]
9-
pub struct Foo<T> {
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct Foo {
1010
pub _address: u8,
11-
pub _phantom_0: ::std::marker::PhantomData<T>,
1211
}
1312
pub type Foo_elem_type<T> = T;
1413
pub type Foo_ptr_type<T> = *mut T;
1514
#[repr(C)]
1615
#[derive(Debug, Default, Copy, Clone)]
17-
pub struct Foo_Bar<T> {
16+
pub struct Foo_Bar {
1817
pub x: ::std::os::raw::c_int,
1918
pub y: ::std::os::raw::c_int,
20-
pub _phantom_0: ::std::marker::PhantomData<T>,
21-
}
22-
impl <T> Default for Foo<T> {
23-
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
2419
}

0 commit comments

Comments
 (0)