Skip to content

Commit

Permalink
Update codegen fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
danobi committed May 10, 2021
1 parent 19a0aaf commit 7b23621
Show file tree
Hide file tree
Showing 205 changed files with 2,090 additions and 418 deletions.
30 changes: 25 additions & 5 deletions tests/expectations/tests/16-byte-alignment.rs
Expand Up @@ -99,7 +99,11 @@ fn bindgen_test_layout_rte_ipv4_tuple__bindgen_ty_1() {
}
impl Default for rte_ipv4_tuple__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
Expand Down Expand Up @@ -143,7 +147,11 @@ fn bindgen_test_layout_rte_ipv4_tuple() {
}
impl Default for rte_ipv4_tuple {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -240,7 +248,11 @@ fn bindgen_test_layout_rte_ipv6_tuple__bindgen_ty_1() {
}
impl Default for rte_ipv6_tuple__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
Expand Down Expand Up @@ -284,7 +296,11 @@ fn bindgen_test_layout_rte_ipv6_tuple() {
}
impl Default for rte_ipv6_tuple {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -333,6 +349,10 @@ fn bindgen_test_layout_rte_thash_tuple() {
}
impl Default for rte_thash_tuple {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
6 changes: 5 additions & 1 deletion tests/expectations/tests/16-byte-alignment_1_0.rs
Expand Up @@ -390,6 +390,10 @@ impl Clone for rte_thash_tuple {
}
impl Default for rte_thash_tuple {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
unsafe {
let mut s: Self = ::std::mem::uninitialized();
::std::ptr::write_bytes(&mut s, 0, 1);
s
}
}
}
12 changes: 10 additions & 2 deletions tests/expectations/tests/allowlist_basic.rs
Expand Up @@ -20,11 +20,19 @@ pub struct AllowlistMe_Inner<T> {
}
impl<T> Default for AllowlistMe_Inner<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
impl<T> Default for AllowlistMe<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
6 changes: 5 additions & 1 deletion tests/expectations/tests/anon-fields-prefix.rs
Expand Up @@ -150,6 +150,10 @@ fn bindgen_test_layout_color() {
}
impl Default for color {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
12 changes: 10 additions & 2 deletions tests/expectations/tests/anon_struct_in_union.rs
Expand Up @@ -74,7 +74,11 @@ fn bindgen_test_layout_s__bindgen_ty_1() {
}
impl Default for s__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
Expand All @@ -97,6 +101,10 @@ fn bindgen_test_layout_s() {
}
impl Default for s {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
18 changes: 15 additions & 3 deletions tests/expectations/tests/anon_union.rs
Expand Up @@ -38,12 +38,20 @@ pub union TErrorResult__bindgen_ty_1 {
}
impl Default for TErrorResult__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
impl Default for TErrorResult {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand All @@ -65,7 +73,11 @@ fn bindgen_test_layout_ErrorResult() {
}
impl Default for ErrorResult {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
Expand Down
12 changes: 10 additions & 2 deletions tests/expectations/tests/anon_union_1_0.rs
Expand Up @@ -83,7 +83,11 @@ pub struct TErrorResult__bindgen_ty_1 {
}
impl Default for TErrorResult {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
unsafe {
let mut s: Self = ::std::mem::uninitialized();
::std::ptr::write_bytes(&mut s, 0, 1);
s
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -111,7 +115,11 @@ impl Clone for ErrorResult {
}
impl Default for ErrorResult {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
unsafe {
let mut s: Self = ::std::mem::uninitialized();
::std::ptr::write_bytes(&mut s, 0, 1);
s
}
}
}
#[test]
Expand Down
12 changes: 10 additions & 2 deletions tests/expectations/tests/anonymous-template-types.rs
Expand Up @@ -13,7 +13,11 @@ pub struct Foo<T> {
}
impl<T> Default for Foo<T> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand All @@ -29,7 +33,11 @@ pub struct Quux<V> {
}
impl<V> Default for Quux<V> {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down
Expand Up @@ -12,7 +12,11 @@ pub struct std_char_traits {
}
impl Default for std_char_traits {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down
6 changes: 5 additions & 1 deletion tests/expectations/tests/bitfield_align_2.rs
Expand Up @@ -121,7 +121,11 @@ fn bindgen_test_layout_TaggedPtr() {
}
impl Default for TaggedPtr {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
impl TaggedPtr {
Expand Down
6 changes: 5 additions & 1 deletion tests/expectations/tests/blocklist-and-impl-debug.rs
Expand Up @@ -40,7 +40,11 @@ fn bindgen_test_layout_ShouldManuallyImplDebug() {
}
impl Default for ShouldManuallyImplDebug {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
impl ::std::fmt::Debug for ShouldManuallyImplDebug {
Expand Down
6 changes: 5 additions & 1 deletion tests/expectations/tests/blocks-signature.rs
Expand Up @@ -76,7 +76,11 @@ fn bindgen_test_layout_contains_block_pointers() {
}
impl Default for contains_block_pointers {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type _bindgen_ty_id_33 = *const ::block::Block<(), ()>;
Expand Down
6 changes: 5 additions & 1 deletion tests/expectations/tests/blocks.rs
Expand Up @@ -75,6 +75,10 @@ fn bindgen_test_layout_contains_block_pointers() {
}
impl Default for contains_block_pointers {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
6 changes: 5 additions & 1 deletion tests/expectations/tests/c_naming.rs
Expand Up @@ -75,7 +75,11 @@ fn bindgen_test_layout_union_b() {
}
impl Default for union_b {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type b = union_b;
Expand Down
42 changes: 35 additions & 7 deletions tests/expectations/tests/class.rs
Expand Up @@ -71,7 +71,11 @@ fn bindgen_test_layout_C() {
}
impl Default for C {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -134,7 +138,11 @@ fn bindgen_test_layout_C_with_zero_length_array() {
}
impl Default for C_with_zero_length_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -203,7 +211,11 @@ fn bindgen_test_layout_C_with_incomplete_array() {
}
impl Default for C_with_incomplete_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -253,7 +265,11 @@ fn bindgen_test_layout_C_with_zero_length_array_and_incomplete_array() {
}
impl Default for C_with_zero_length_array_and_incomplete_array {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -332,7 +348,11 @@ fn bindgen_test_layout_IncompleteArrayNonCopiable() {
}
impl Default for IncompleteArrayNonCopiable {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -366,7 +386,11 @@ fn bindgen_test_layout_Union() {
}
impl Default for Union {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down Expand Up @@ -401,7 +425,11 @@ fn bindgen_test_layout_WithUnion() {
}
impl Default for WithUnion {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
Expand Down

0 comments on commit 7b23621

Please sign in to comment.