blob: 1e5e6a5933b4bed291f7e7f4102812acb7980a4f [file] [log] [blame]
Marcel Hlopko14ee3c82022-02-09 09:46:23 +00001// Part of the Crubit project, under the Apache License v2.0 with LLVM
2// Exceptions. See /LICENSE for license information.
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5// Automatically @generated Rust bindings for C++ target
6// //rs_bindings_from_cc/test/golden:clang_attrs_cc
Lukasz Anforowicz72c4d222022-02-18 19:07:28 +00007#![rustfmt::skip]
8#![feature(const_ptr_offset_from, custom_inner_attributes, negative_impls)]
Marcel Hlopko14ee3c82022-02-09 09:46:23 +00009#![allow(non_camel_case_types)]
10#![allow(non_snake_case)]
11
Lukasz Anforowiczfed64e62022-03-22 22:39:04 +000012extern crate static_assertions;
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000013use memoffset_unstable_const::offset_of;
Lukasz Anforowiczfed64e62022-03-22 22:39:04 +000014use static_assertions::{assert_impl_all, assert_not_impl_all};
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000015
16pub type __builtin_ms_va_list = *mut u8;
17
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000018// Part of the Crubit project, under the Apache License v2.0 with LLVM
19// Exceptions. See /LICENSE for license information.
20// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
21
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000022#[repr(C, align(64))]
23pub struct HasCustomAlignment {
24 /// Prevent empty C++ struct being zero-size in Rust.
25 placeholder: std::mem::MaybeUninit<u8>,
26}
27
28impl !Unpin for HasCustomAlignment {}
29
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000030// rs_bindings_from_cc/test/golden/clang_attrs.h;l=8
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000031// Error while generating bindings for item 'HasCustomAlignment::HasCustomAlignment':
Devin Jeanpierre6f607372022-03-22 21:34:38 +000032// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000033
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000034// rs_bindings_from_cc/test/golden/clang_attrs.h;l=8
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000035// Error while generating bindings for item 'HasCustomAlignment::HasCustomAlignment':
Devin Jeanpierre6f607372022-03-22 21:34:38 +000036// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000037
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000038// rs_bindings_from_cc/test/golden/clang_attrs.h;l=8
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000039// Error while generating bindings for item 'HasCustomAlignment::HasCustomAlignment':
Lukasz Anforowicze9333582022-03-07 15:27:06 +000040// Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignment &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000041
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000042// rs_bindings_from_cc/test/golden/clang_attrs.h;l=8
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000043// Error while generating bindings for item 'HasCustomAlignment::operator=':
44// Bindings for this kind of operator are not supported
45
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000046// rs_bindings_from_cc/test/golden/clang_attrs.h;l=8
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000047// Error while generating bindings for item 'HasCustomAlignment::operator=':
Lukasz Anforowicze9333582022-03-07 15:27:06 +000048// Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignment &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000049
50#[repr(C)]
51pub struct HasFieldWithCustomAlignment {
52 pub field: HasCustomAlignment,
53}
54
55impl !Unpin for HasFieldWithCustomAlignment {}
56
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000057// rs_bindings_from_cc/test/golden/clang_attrs.h;l=10
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000058// Error while generating bindings for item 'HasFieldWithCustomAlignment::HasFieldWithCustomAlignment':
Devin Jeanpierre6f607372022-03-22 21:34:38 +000059// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000060
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000061// rs_bindings_from_cc/test/golden/clang_attrs.h;l=10
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000062// Error while generating bindings for item 'HasFieldWithCustomAlignment::HasFieldWithCustomAlignment':
Devin Jeanpierre6f607372022-03-22 21:34:38 +000063// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000064
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000065// rs_bindings_from_cc/test/golden/clang_attrs.h;l=10
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000066// Error while generating bindings for item 'HasFieldWithCustomAlignment::HasFieldWithCustomAlignment':
Lukasz Anforowicze9333582022-03-07 15:27:06 +000067// Parameter #0 is not supported: Unsupported type 'struct HasFieldWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000068
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000069// rs_bindings_from_cc/test/golden/clang_attrs.h;l=10
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000070// Error while generating bindings for item 'HasFieldWithCustomAlignment::operator=':
71// Bindings for this kind of operator are not supported
72
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000073// rs_bindings_from_cc/test/golden/clang_attrs.h;l=10
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000074// Error while generating bindings for item 'HasFieldWithCustomAlignment::operator=':
Lukasz Anforowicze9333582022-03-07 15:27:06 +000075// Parameter #0 is not supported: Unsupported type 'struct HasFieldWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000076
77#[repr(C, align(64))]
78pub struct InheritsFromBaseWithCustomAlignment {
79 __base_class_subobjects: [std::mem::MaybeUninit<u8>; 0],
80 /// Prevent empty C++ struct being zero-size in Rust.
81 placeholder: std::mem::MaybeUninit<u8>,
82}
83impl<'a> From<&'a InheritsFromBaseWithCustomAlignment> for &'a HasCustomAlignment {
84 fn from(x: &'a InheritsFromBaseWithCustomAlignment) -> Self {
85 unsafe { &*((x as *const _ as *const u8).offset(0) as *const HasCustomAlignment) }
86 }
87}
88
89impl !Unpin for InheritsFromBaseWithCustomAlignment {}
90
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000091// rs_bindings_from_cc/test/golden/clang_attrs.h;l=14
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000092// Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::InheritsFromBaseWithCustomAlignment':
Devin Jeanpierre6f607372022-03-22 21:34:38 +000093// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000094
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000095// rs_bindings_from_cc/test/golden/clang_attrs.h;l=14
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000096// Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::InheritsFromBaseWithCustomAlignment':
Devin Jeanpierre6f607372022-03-22 21:34:38 +000097// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +000098
Marcel Hlopkoe31c8682022-03-16 19:44:36 +000099// rs_bindings_from_cc/test/golden/clang_attrs.h;l=14
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000100// Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::InheritsFromBaseWithCustomAlignment':
Lukasz Anforowicze9333582022-03-07 15:27:06 +0000101// Parameter #0 is not supported: Unsupported type 'struct InheritsFromBaseWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000102
Marcel Hlopkoe31c8682022-03-16 19:44:36 +0000103// rs_bindings_from_cc/test/golden/clang_attrs.h;l=14
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000104// Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::operator=':
105// Bindings for this kind of operator are not supported
106
Marcel Hlopkoe31c8682022-03-16 19:44:36 +0000107// rs_bindings_from_cc/test/golden/clang_attrs.h;l=14
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000108// Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::operator=':
Lukasz Anforowicze9333582022-03-07 15:27:06 +0000109// Parameter #0 is not supported: Unsupported type 'struct InheritsFromBaseWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000110
111#[repr(C, align(64))]
112pub struct HasCustomAlignmentWithGnuAttr {
113 /// Prevent empty C++ struct being zero-size in Rust.
114 placeholder: std::mem::MaybeUninit<u8>,
115}
116
117impl !Unpin for HasCustomAlignmentWithGnuAttr {}
118
Marcel Hlopkoe31c8682022-03-16 19:44:36 +0000119// rs_bindings_from_cc/test/golden/clang_attrs.h;l=16
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000120// Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::HasCustomAlignmentWithGnuAttr':
Devin Jeanpierre6f607372022-03-22 21:34:38 +0000121// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000122
Marcel Hlopkoe31c8682022-03-16 19:44:36 +0000123// rs_bindings_from_cc/test/golden/clang_attrs.h;l=16
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000124// Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::HasCustomAlignmentWithGnuAttr':
Devin Jeanpierre6f607372022-03-22 21:34:38 +0000125// Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000126
Marcel Hlopkoe31c8682022-03-16 19:44:36 +0000127// rs_bindings_from_cc/test/golden/clang_attrs.h;l=16
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000128// Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::HasCustomAlignmentWithGnuAttr':
Lukasz Anforowicze9333582022-03-07 15:27:06 +0000129// Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignmentWithGnuAttr &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000130
Marcel Hlopkoe31c8682022-03-16 19:44:36 +0000131// rs_bindings_from_cc/test/golden/clang_attrs.h;l=16
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000132// Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::operator=':
133// Bindings for this kind of operator are not supported
134
Marcel Hlopkoe31c8682022-03-16 19:44:36 +0000135// rs_bindings_from_cc/test/golden/clang_attrs.h;l=16
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000136// Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::operator=':
Lukasz Anforowicze9333582022-03-07 15:27:06 +0000137// Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignmentWithGnuAttr &&': Unsupported clang::Type class 'RValueReference'
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000138
Dmitri Gribenkoe4e77d02022-03-17 14:09:39 +0000139// CRUBIT_RS_BINDINGS_FROM_CC_TEST_GOLDEN_CLANG_ATTRS_H_
Marcel Hlopko14ee3c82022-02-09 09:46:23 +0000140
141const _: () = assert!(std::mem::size_of::<Option<&i32>>() == std::mem::size_of::<&i32>());
142
143const _: () = assert!(std::mem::size_of::<HasCustomAlignment>() == 64usize);
144const _: () = assert!(std::mem::align_of::<HasCustomAlignment>() == 64usize);
145
146const _: () = assert!(std::mem::size_of::<HasFieldWithCustomAlignment>() == 64usize);
147const _: () = assert!(std::mem::align_of::<HasFieldWithCustomAlignment>() == 64usize);
148const _: () = assert!(offset_of!(HasFieldWithCustomAlignment, field) * 8 == 0usize);
149
150const _: () = assert!(std::mem::size_of::<InheritsFromBaseWithCustomAlignment>() == 64usize);
151const _: () = assert!(std::mem::align_of::<InheritsFromBaseWithCustomAlignment>() == 64usize);
152
153const _: () = assert!(std::mem::size_of::<HasCustomAlignmentWithGnuAttr>() == 64usize);
154const _: () = assert!(std::mem::align_of::<HasCustomAlignmentWithGnuAttr>() == 64usize);