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 8, 2021
1 parent 19a0aaf commit 3a70161
Show file tree
Hide file tree
Showing 195 changed files with 1,990 additions and 398 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
18 changes: 15 additions & 3 deletions tests/expectations/tests/class_nested.rs
Expand Up @@ -48,7 +48,11 @@ pub struct A_D<T> {
}
impl<T> Default for A_D<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()
}
}
}
#[test]
Expand Down Expand Up @@ -159,11 +163,19 @@ pub struct Templated_Templated_inner<T> {
}
impl<T> Default for Templated_Templated_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 Templated<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()
}
}
}
12 changes: 10 additions & 2 deletions tests/expectations/tests/class_with_dtor.rs
Expand Up @@ -13,7 +13,11 @@ pub struct HandleWithDtor<T> {
}
impl<T> Default for HandleWithDtor<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()
}
}
}
pub type HandleValue = HandleWithDtor<::std::os::raw::c_int>;
Expand Down Expand Up @@ -50,7 +54,11 @@ fn bindgen_test_layout_WithoutDtor() {
}
impl Default for WithoutDtor {
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

0 comments on commit 3a70161

Please sign in to comment.