Skip to content

Commit 6e1d3fb

Browse files
committed
[DO NOT MERGE] Example try run, not to be merged.
1 parent 2916bea commit 6e1d3fb

File tree

93 files changed

+190
-467
lines changed

Some content is hidden

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

93 files changed

+190
-467
lines changed

tests/expectations/accessors.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/annotation_hide.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/anon_enum.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/anon_enum_whitelist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/anon_union.rs

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

7-
#[derive(Debug)]
88
#[repr(C)]
9-
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
10-
impl <T> __BindgenUnionField<T> {
11-
#[inline]
12-
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
13-
#[inline]
14-
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
15-
#[inline]
16-
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
17-
}
18-
impl <T> ::std::default::Default for __BindgenUnionField<T> {
19-
#[inline]
20-
fn default() -> Self { Self::new() }
21-
}
22-
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
23-
#[inline]
24-
fn clone(&self) -> Self { Self::new() }
25-
}
26-
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
27-
#[repr(C)]
28-
#[derive(Debug, Copy, Clone)]
299
pub struct TErrorResult<T> {
3010
pub mResult: ::std::os::raw::c_int,
3111
pub __bindgen_anon_1: TErrorResult__bindgen_ty_bindgen_id_10<T>,
@@ -51,15 +31,12 @@ pub struct TErrorResult_DOMExceptionInfo<T> {
5131
pub _phantom_0: ::std::marker::PhantomData<T>,
5232
}
5333
#[repr(C)]
54-
#[derive(Debug, Copy, Clone)]
55-
pub struct TErrorResult__bindgen_ty_bindgen_id_10<T> {
56-
pub mMessage: __BindgenUnionField<*mut TErrorResult_Message<T>>,
57-
pub mDOMExceptionInfo: __BindgenUnionField<*mut TErrorResult_DOMExceptionInfo<T>>,
58-
pub bindgen_union_field: u64,
34+
pub union TErrorResult__bindgen_ty_bindgen_id_10<T> {
35+
pub mMessage: *mut TErrorResult_Message<T>,
36+
pub mDOMExceptionInfo: *mut TErrorResult_DOMExceptionInfo<T>,
5937
pub _phantom_0: ::std::marker::PhantomData<T>,
6038
}
6139
#[repr(C)]
62-
#[derive(Debug, Copy)]
6340
pub struct ErrorResult {
6441
pub _base: TErrorResult<::std::os::raw::c_int>,
6542
}
@@ -68,6 +45,3 @@ fn bindgen_test_layout_ErrorResult() {
6845
assert_eq!(::std::mem::size_of::<ErrorResult>() , 24usize);
6946
assert_eq!(::std::mem::align_of::<ErrorResult>() , 8usize);
7047
}
71-
impl Clone for ErrorResult {
72-
fn clone(&self) -> Self { *self }
73-
}

tests/expectations/arg_keyword.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/blocks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/class.rs

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

7-
#[derive(Debug)]
8-
#[repr(C)]
9-
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
10-
impl <T> __BindgenUnionField<T> {
11-
#[inline]
12-
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
13-
#[inline]
14-
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
15-
#[inline]
16-
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
17-
}
18-
impl <T> ::std::default::Default for __BindgenUnionField<T> {
19-
#[inline]
20-
fn default() -> Self { Self::new() }
21-
}
22-
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
23-
#[inline]
24-
fn clone(&self) -> Self { Self::new() }
25-
}
26-
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
278
#[repr(C)]
289
pub struct C {
2910
pub a: ::std::os::raw::c_int,
@@ -45,11 +26,10 @@ fn bindgen_test_layout_WithDtor() {
4526
assert_eq!(::std::mem::align_of::<WithDtor>() , 4usize);
4627
}
4728
#[repr(C)]
48-
#[derive(Debug, Copy)]
49-
pub struct Union {
50-
pub d: __BindgenUnionField<f32>,
51-
pub i: __BindgenUnionField<::std::os::raw::c_int>,
52-
pub bindgen_union_field: u32,
29+
#[derive(Copy)]
30+
pub union Union {
31+
pub d: f32,
32+
pub i: ::std::os::raw::c_int,
5333
}
5434
#[test]
5535
fn bindgen_test_layout_Union() {
@@ -60,7 +40,7 @@ impl Clone for Union {
6040
fn clone(&self) -> Self { *self }
6141
}
6242
#[repr(C)]
63-
#[derive(Debug, Copy)]
43+
#[derive(Copy)]
6444
pub struct WithUnion {
6545
pub data: Union,
6646
}

tests/expectations/class_nested.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/class_no_members.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/class_static.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/class_use_as.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/class_with_dtor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/class_with_inner_struct.rs

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,12 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

7-
#[derive(Debug)]
88
#[repr(C)]
9-
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
10-
impl <T> __BindgenUnionField<T> {
11-
#[inline]
12-
pub fn new() -> Self { __BindgenUnionField(::std::marker::PhantomData) }
13-
#[inline]
14-
pub unsafe fn as_ref(&self) -> &T { ::std::mem::transmute(self) }
15-
#[inline]
16-
pub unsafe fn as_mut(&mut self) -> &mut T { ::std::mem::transmute(self) }
17-
}
18-
impl <T> ::std::default::Default for __BindgenUnionField<T> {
19-
#[inline]
20-
fn default() -> Self { Self::new() }
21-
}
22-
impl <T> ::std::clone::Clone for __BindgenUnionField<T> {
23-
#[inline]
24-
fn clone(&self) -> Self { Self::new() }
25-
}
26-
impl <T> ::std::marker::Copy for __BindgenUnionField<T> { }
27-
#[repr(C)]
28-
#[derive(Debug, Copy)]
9+
#[derive(Copy)]
2910
pub struct A {
3011
pub c: ::std::os::raw::c_uint,
3112
pub named_union: A__bindgen_ty_bindgen_id_9,
@@ -46,10 +27,9 @@ impl Clone for A_Segment {
4627
fn clone(&self) -> Self { *self }
4728
}
4829
#[repr(C)]
49-
#[derive(Debug, Copy)]
50-
pub struct A__bindgen_ty_bindgen_id_9 {
51-
pub f: __BindgenUnionField<::std::os::raw::c_int>,
52-
pub bindgen_union_field: u32,
30+
#[derive(Copy)]
31+
pub union A__bindgen_ty_bindgen_id_9 {
32+
pub f: ::std::os::raw::c_int,
5333
}
5434
#[test]
5535
fn bindgen_test_layout_A__bindgen_ty_bindgen_id_9() {
@@ -60,10 +40,9 @@ impl Clone for A__bindgen_ty_bindgen_id_9 {
6040
fn clone(&self) -> Self { *self }
6141
}
6242
#[repr(C)]
63-
#[derive(Debug, Copy)]
64-
pub struct A__bindgen_ty_bindgen_id_14 {
65-
pub d: __BindgenUnionField<::std::os::raw::c_int>,
66-
pub bindgen_union_field: u32,
43+
#[derive(Copy)]
44+
pub union A__bindgen_ty_bindgen_id_14 {
45+
pub d: ::std::os::raw::c_int,
6746
}
6847
#[test]
6948
fn bindgen_test_layout_A__bindgen_ty_bindgen_id_14() {
@@ -118,17 +97,16 @@ pub enum StepSyntax {
11897
FunctionalWithEndKeyword = 3,
11998
}
12099
#[repr(C)]
121-
#[derive(Debug, Copy)]
100+
#[derive(Copy)]
122101
pub struct C {
123102
pub d: ::std::os::raw::c_uint,
124103
pub __bindgen_anon_1: C__bindgen_ty_bindgen_id_31,
125104
}
126105
#[repr(C)]
127-
#[derive(Debug, Copy)]
128-
pub struct C__bindgen_ty_bindgen_id_31 {
129-
pub mFunc: __BindgenUnionField<C__bindgen_ty_bindgen_id_31__bindgen_ty_bindgen_id_32>,
130-
pub __bindgen_anon_1: __BindgenUnionField<C__bindgen_ty_bindgen_id_31__bindgen_ty_bindgen_id_43>,
131-
pub bindgen_union_field: [u32; 4usize],
106+
#[derive(Copy)]
107+
pub union C__bindgen_ty_bindgen_id_31 {
108+
pub mFunc: C__bindgen_ty_bindgen_id_31__bindgen_ty_bindgen_id_32,
109+
pub __bindgen_anon_1: C__bindgen_ty_bindgen_id_31__bindgen_ty_bindgen_id_43,
132110
}
133111
#[repr(C)]
134112
#[derive(Debug, Copy)]

tests/expectations/class_with_typedef.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/const_ptr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/const_resolved_ty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/const_tparam.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/crtp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/decl_ptr_to_array.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/duplicated_constants_in_ns.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/empty_template_param_name.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/enum.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/enum_alias.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/enum_and_vtable_mangling.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/enum_dupe.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/enum_explicit_type.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

tests/expectations/enum_negative.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* automatically generated by rust-bindgen */
22

33

4+
#![feature(untagged_unions)]
45
#![allow(non_snake_case)]
56

67

0 commit comments

Comments
 (0)