Skip to content

Commit 225d49b

Browse files
committed
Update codegen fixtures
1 parent 19a0aaf commit 225d49b

File tree

205 files changed

+2090
-418
lines changed

Some content is hidden

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

205 files changed

+2090
-418
lines changed

tests/expectations/tests/16-byte-alignment.rs

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() {
9999
}
100100
impl Default for rte_ipv4_tuple__bindgen_ty_1 {
101101
fn default() -> Self {
102-
unsafe { ::std::mem::zeroed() }
102+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
103+
unsafe {
104+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
105+
s.assume_init()
106+
}
103107
}
104108
}
105109
#[test]
@@ -143,7 +147,11 @@ fn bindgen_test_layout_rte_ipv4_tuple() {
143147
}
144148
impl Default for rte_ipv4_tuple {
145149
fn default() -> Self {
146-
unsafe { ::std::mem::zeroed() }
150+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
151+
unsafe {
152+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
153+
s.assume_init()
154+
}
147155
}
148156
}
149157
#[repr(C)]
@@ -240,7 +248,11 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() {
240248
}
241249
impl Default for rte_ipv6_tuple__bindgen_ty_1 {
242250
fn default() -> Self {
243-
unsafe { ::std::mem::zeroed() }
251+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
252+
unsafe {
253+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
254+
s.assume_init()
255+
}
244256
}
245257
}
246258
#[test]
@@ -284,7 +296,11 @@ fn bindgen_test_layout_rte_ipv6_tuple() {
284296
}
285297
impl Default for rte_ipv6_tuple {
286298
fn default() -> Self {
287-
unsafe { ::std::mem::zeroed() }
299+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
300+
unsafe {
301+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
302+
s.assume_init()
303+
}
288304
}
289305
}
290306
#[repr(C)]
@@ -333,6 +349,10 @@ fn bindgen_test_layout_rte_thash_tuple() {
333349
}
334350
impl Default for rte_thash_tuple {
335351
fn default() -> Self {
336-
unsafe { ::std::mem::zeroed() }
352+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
353+
unsafe {
354+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
355+
s.assume_init()
356+
}
337357
}
338358
}

tests/expectations/tests/16-byte-alignment_1_0.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ impl Clone for rte_thash_tuple {
390390
}
391391
impl Default for rte_thash_tuple {
392392
fn default() -> Self {
393-
unsafe { ::std::mem::zeroed() }
393+
unsafe {
394+
let mut s: Self = ::std::mem::uninitialized();
395+
::std::ptr::write_bytes(&mut s, 0, 1);
396+
s
397+
}
394398
}
395399
}

tests/expectations/tests/allowlist_basic.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,19 @@ pub struct AllowlistMe_Inner<T> {
2020
}
2121
impl<T> Default for AllowlistMe_Inner<T> {
2222
fn default() -> Self {
23-
unsafe { ::std::mem::zeroed() }
23+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
24+
unsafe {
25+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
26+
s.assume_init()
27+
}
2428
}
2529
}
2630
impl<T> Default for AllowlistMe<T> {
2731
fn default() -> Self {
28-
unsafe { ::std::mem::zeroed() }
32+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
33+
unsafe {
34+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
35+
s.assume_init()
36+
}
2937
}
3038
}

tests/expectations/tests/anon-fields-prefix.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ fn bindgen_test_layout_color() {
150150
}
151151
impl Default for color {
152152
fn default() -> Self {
153-
unsafe { ::std::mem::zeroed() }
153+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
154+
unsafe {
155+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
156+
s.assume_init()
157+
}
154158
}
155159
}

tests/expectations/tests/anon_struct_in_union.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ fn bindgen_test_layout_s__bindgen_ty_1() {
7474
}
7575
impl Default for s__bindgen_ty_1 {
7676
fn default() -> Self {
77-
unsafe { ::std::mem::zeroed() }
77+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
78+
unsafe {
79+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
80+
s.assume_init()
81+
}
7882
}
7983
}
8084
#[test]
@@ -97,6 +101,10 @@ fn bindgen_test_layout_s() {
97101
}
98102
impl Default for s {
99103
fn default() -> Self {
100-
unsafe { ::std::mem::zeroed() }
104+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
105+
unsafe {
106+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
107+
s.assume_init()
108+
}
101109
}
102110
}

tests/expectations/tests/anon_union.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,20 @@ pub union TErrorResult__bindgen_ty_1 {
3838
}
3939
impl Default for TErrorResult__bindgen_ty_1 {
4040
fn default() -> Self {
41-
unsafe { ::std::mem::zeroed() }
41+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
42+
unsafe {
43+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
44+
s.assume_init()
45+
}
4246
}
4347
}
4448
impl Default for TErrorResult {
4549
fn default() -> Self {
46-
unsafe { ::std::mem::zeroed() }
50+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
51+
unsafe {
52+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
53+
s.assume_init()
54+
}
4755
}
4856
}
4957
#[repr(C)]
@@ -65,7 +73,11 @@ fn bindgen_test_layout_ErrorResult() {
6573
}
6674
impl Default for ErrorResult {
6775
fn default() -> Self {
68-
unsafe { ::std::mem::zeroed() }
76+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
77+
unsafe {
78+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
79+
s.assume_init()
80+
}
6981
}
7082
}
7183
#[test]

tests/expectations/tests/anon_union_1_0.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ pub struct TErrorResult__bindgen_ty_1 {
8383
}
8484
impl Default for TErrorResult {
8585
fn default() -> Self {
86-
unsafe { ::std::mem::zeroed() }
86+
unsafe {
87+
let mut s: Self = ::std::mem::uninitialized();
88+
::std::ptr::write_bytes(&mut s, 0, 1);
89+
s
90+
}
8791
}
8892
}
8993
#[repr(C)]
@@ -111,7 +115,11 @@ impl Clone for ErrorResult {
111115
}
112116
impl Default for ErrorResult {
113117
fn default() -> Self {
114-
unsafe { ::std::mem::zeroed() }
118+
unsafe {
119+
let mut s: Self = ::std::mem::uninitialized();
120+
::std::ptr::write_bytes(&mut s, 0, 1);
121+
s
122+
}
115123
}
116124
}
117125
#[test]

tests/expectations/tests/anonymous-template-types.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ pub struct Foo<T> {
1313
}
1414
impl<T> Default for Foo<T> {
1515
fn default() -> Self {
16-
unsafe { ::std::mem::zeroed() }
16+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
17+
unsafe {
18+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
19+
s.assume_init()
20+
}
1721
}
1822
}
1923
#[repr(C)]
@@ -29,7 +33,11 @@ pub struct Quux<V> {
2933
}
3034
impl<V> Default for Quux<V> {
3135
fn default() -> Self {
32-
unsafe { ::std::mem::zeroed() }
36+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
37+
unsafe {
38+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
39+
s.assume_init()
40+
}
3341
}
3442
}
3543
#[repr(C)]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ pub struct std_char_traits {
1212
}
1313
impl Default for std_char_traits {
1414
fn default() -> Self {
15-
unsafe { ::std::mem::zeroed() }
15+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
16+
unsafe {
17+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
18+
s.assume_init()
19+
}
1620
}
1721
}
1822
#[repr(C)]

tests/expectations/tests/bitfield_align_2.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ fn bindgen_test_layout_TaggedPtr() {
121121
}
122122
impl Default for TaggedPtr {
123123
fn default() -> Self {
124-
unsafe { ::std::mem::zeroed() }
124+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
125+
unsafe {
126+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
127+
s.assume_init()
128+
}
125129
}
126130
}
127131
impl TaggedPtr {

tests/expectations/tests/blocklist-and-impl-debug.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ fn bindgen_test_layout_ShouldManuallyImplDebug() {
4040
}
4141
impl Default for ShouldManuallyImplDebug {
4242
fn default() -> Self {
43-
unsafe { ::std::mem::zeroed() }
43+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
44+
unsafe {
45+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
46+
s.assume_init()
47+
}
4448
}
4549
}
4650
impl ::std::fmt::Debug for ShouldManuallyImplDebug {

tests/expectations/tests/blocks-signature.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ fn bindgen_test_layout_contains_block_pointers() {
7676
}
7777
impl Default for contains_block_pointers {
7878
fn default() -> Self {
79-
unsafe { ::std::mem::zeroed() }
79+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
80+
unsafe {
81+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
82+
s.assume_init()
83+
}
8084
}
8185
}
8286
pub type _bindgen_ty_id_33 = *const ::block::Block<(), ()>;

tests/expectations/tests/blocks.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ fn bindgen_test_layout_contains_block_pointers() {
7575
}
7676
impl Default for contains_block_pointers {
7777
fn default() -> Self {
78-
unsafe { ::std::mem::zeroed() }
78+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
79+
unsafe {
80+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
81+
s.assume_init()
82+
}
7983
}
8084
}

tests/expectations/tests/c_naming.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ fn bindgen_test_layout_union_b() {
7575
}
7676
impl Default for union_b {
7777
fn default() -> Self {
78-
unsafe { ::std::mem::zeroed() }
78+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
79+
unsafe {
80+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
81+
s.assume_init()
82+
}
7983
}
8084
}
8185
pub type b = union_b;

tests/expectations/tests/class.rs

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ fn bindgen_test_layout_C() {
7171
}
7272
impl Default for C {
7373
fn default() -> Self {
74-
unsafe { ::std::mem::zeroed() }
74+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
75+
unsafe {
76+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
77+
s.assume_init()
78+
}
7579
}
7680
}
7781
#[repr(C)]
@@ -134,7 +138,11 @@ fn bindgen_test_layout_C_with_zero_length_array() {
134138
}
135139
impl Default for C_with_zero_length_array {
136140
fn default() -> Self {
137-
unsafe { ::std::mem::zeroed() }
141+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
142+
unsafe {
143+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
144+
s.assume_init()
145+
}
138146
}
139147
}
140148
#[repr(C)]
@@ -203,7 +211,11 @@ fn bindgen_test_layout_C_with_incomplete_array() {
203211
}
204212
impl Default for C_with_incomplete_array {
205213
fn default() -> Self {
206-
unsafe { ::std::mem::zeroed() }
214+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
215+
unsafe {
216+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
217+
s.assume_init()
218+
}
207219
}
208220
}
209221
#[repr(C)]
@@ -253,7 +265,11 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
253265
}
254266
impl Default for C_with_zero_length_array_and_incomplete_array {
255267
fn default() -> Self {
256-
unsafe { ::std::mem::zeroed() }
268+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
269+
unsafe {
270+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
271+
s.assume_init()
272+
}
257273
}
258274
}
259275
#[repr(C)]
@@ -332,7 +348,11 @@ fn bindgen_test_layout_IncompleteArrayNonCopiable() {
332348
}
333349
impl Default for IncompleteArrayNonCopiable {
334350
fn default() -> Self {
335-
unsafe { ::std::mem::zeroed() }
351+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
352+
unsafe {
353+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
354+
s.assume_init()
355+
}
336356
}
337357
}
338358
#[repr(C)]
@@ -366,7 +386,11 @@ fn bindgen_test_layout_Union() {
366386
}
367387
impl Default for Union {
368388
fn default() -> Self {
369-
unsafe { ::std::mem::zeroed() }
389+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
390+
unsafe {
391+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
392+
s.assume_init()
393+
}
370394
}
371395
}
372396
#[repr(C)]
@@ -401,7 +425,11 @@ fn bindgen_test_layout_WithUnion() {
401425
}
402426
impl Default for WithUnion {
403427
fn default() -> Self {
404-
unsafe { ::std::mem::zeroed() }
428+
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
429+
unsafe {
430+
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
431+
s.assume_init()
432+
}
405433
}
406434
}
407435
#[repr(C)]

0 commit comments

Comments
 (0)