Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 1 | // 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 Anforowicz | 72c4d22 | 2022-02-18 19:07:28 +0000 | [diff] [blame] | 7 | #![rustfmt::skip] |
| 8 | #![feature(const_ptr_offset_from, custom_inner_attributes, negative_impls)] |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 9 | #![allow(non_camel_case_types)] |
| 10 | #![allow(non_snake_case)] |
| 11 | |
Lukasz Anforowicz | fed64e6 | 2022-03-22 22:39:04 +0000 | [diff] [blame^] | 12 | extern crate static_assertions; |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 13 | use memoffset_unstable_const::offset_of; |
Lukasz Anforowicz | fed64e6 | 2022-03-22 22:39:04 +0000 | [diff] [blame^] | 14 | use static_assertions::{assert_impl_all, assert_not_impl_all}; |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 15 | |
| 16 | pub type __builtin_ms_va_list = *mut u8; |
| 17 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 18 | // 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 Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 22 | #[repr(C, align(64))] |
| 23 | pub struct HasCustomAlignment { |
| 24 | /// Prevent empty C++ struct being zero-size in Rust. |
| 25 | placeholder: std::mem::MaybeUninit<u8>, |
| 26 | } |
| 27 | |
| 28 | impl !Unpin for HasCustomAlignment {} |
| 29 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 30 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=8 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 31 | // Error while generating bindings for item 'HasCustomAlignment::HasCustomAlignment': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 32 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 33 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 34 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=8 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 35 | // Error while generating bindings for item 'HasCustomAlignment::HasCustomAlignment': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 36 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 37 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 38 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=8 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 39 | // Error while generating bindings for item 'HasCustomAlignment::HasCustomAlignment': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 40 | // Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignment &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 41 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 42 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=8 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 43 | // Error while generating bindings for item 'HasCustomAlignment::operator=': |
| 44 | // Bindings for this kind of operator are not supported |
| 45 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 46 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=8 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 47 | // Error while generating bindings for item 'HasCustomAlignment::operator=': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 48 | // Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignment &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 49 | |
| 50 | #[repr(C)] |
| 51 | pub struct HasFieldWithCustomAlignment { |
| 52 | pub field: HasCustomAlignment, |
| 53 | } |
| 54 | |
| 55 | impl !Unpin for HasFieldWithCustomAlignment {} |
| 56 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 57 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=10 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 58 | // Error while generating bindings for item 'HasFieldWithCustomAlignment::HasFieldWithCustomAlignment': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 59 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 60 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 61 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=10 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 62 | // Error while generating bindings for item 'HasFieldWithCustomAlignment::HasFieldWithCustomAlignment': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 63 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 64 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 65 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=10 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 66 | // Error while generating bindings for item 'HasFieldWithCustomAlignment::HasFieldWithCustomAlignment': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 67 | // Parameter #0 is not supported: Unsupported type 'struct HasFieldWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 68 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 69 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=10 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 70 | // Error while generating bindings for item 'HasFieldWithCustomAlignment::operator=': |
| 71 | // Bindings for this kind of operator are not supported |
| 72 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 73 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=10 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 74 | // Error while generating bindings for item 'HasFieldWithCustomAlignment::operator=': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 75 | // Parameter #0 is not supported: Unsupported type 'struct HasFieldWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 76 | |
| 77 | #[repr(C, align(64))] |
| 78 | pub 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 | } |
| 83 | impl<'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 | |
| 89 | impl !Unpin for InheritsFromBaseWithCustomAlignment {} |
| 90 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 91 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=14 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 92 | // Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::InheritsFromBaseWithCustomAlignment': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 93 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 94 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 95 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=14 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 96 | // Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::InheritsFromBaseWithCustomAlignment': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 97 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 98 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 99 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=14 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 100 | // Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::InheritsFromBaseWithCustomAlignment': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 101 | // Parameter #0 is not supported: Unsupported type 'struct InheritsFromBaseWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 102 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 103 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=14 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 104 | // Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::operator=': |
| 105 | // Bindings for this kind of operator are not supported |
| 106 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 107 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=14 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 108 | // Error while generating bindings for item 'InheritsFromBaseWithCustomAlignment::operator=': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 109 | // Parameter #0 is not supported: Unsupported type 'struct InheritsFromBaseWithCustomAlignment &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 110 | |
| 111 | #[repr(C, align(64))] |
| 112 | pub struct HasCustomAlignmentWithGnuAttr { |
| 113 | /// Prevent empty C++ struct being zero-size in Rust. |
| 114 | placeholder: std::mem::MaybeUninit<u8>, |
| 115 | } |
| 116 | |
| 117 | impl !Unpin for HasCustomAlignmentWithGnuAttr {} |
| 118 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 119 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=16 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 120 | // Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::HasCustomAlignmentWithGnuAttr': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 121 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 122 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 123 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=16 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 124 | // Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::HasCustomAlignmentWithGnuAttr': |
Devin Jeanpierre | 6f60737 | 2022-03-22 21:34:38 +0000 | [diff] [blame] | 125 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 126 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 127 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=16 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 128 | // Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::HasCustomAlignmentWithGnuAttr': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 129 | // Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignmentWithGnuAttr &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 130 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 131 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=16 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 132 | // Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::operator=': |
| 133 | // Bindings for this kind of operator are not supported |
| 134 | |
Marcel Hlopko | e31c868 | 2022-03-16 19:44:36 +0000 | [diff] [blame] | 135 | // rs_bindings_from_cc/test/golden/clang_attrs.h;l=16 |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 136 | // Error while generating bindings for item 'HasCustomAlignmentWithGnuAttr::operator=': |
Lukasz Anforowicz | e933358 | 2022-03-07 15:27:06 +0000 | [diff] [blame] | 137 | // Parameter #0 is not supported: Unsupported type 'struct HasCustomAlignmentWithGnuAttr &&': Unsupported clang::Type class 'RValueReference' |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 138 | |
Dmitri Gribenko | e4e77d0 | 2022-03-17 14:09:39 +0000 | [diff] [blame] | 139 | // CRUBIT_RS_BINDINGS_FROM_CC_TEST_GOLDEN_CLANG_ATTRS_H_ |
Marcel Hlopko | 14ee3c8 | 2022-02-09 09:46:23 +0000 | [diff] [blame] | 140 | |
| 141 | const _: () = assert!(std::mem::size_of::<Option<&i32>>() == std::mem::size_of::<&i32>()); |
| 142 | |
| 143 | const _: () = assert!(std::mem::size_of::<HasCustomAlignment>() == 64usize); |
| 144 | const _: () = assert!(std::mem::align_of::<HasCustomAlignment>() == 64usize); |
| 145 | |
| 146 | const _: () = assert!(std::mem::size_of::<HasFieldWithCustomAlignment>() == 64usize); |
| 147 | const _: () = assert!(std::mem::align_of::<HasFieldWithCustomAlignment>() == 64usize); |
| 148 | const _: () = assert!(offset_of!(HasFieldWithCustomAlignment, field) * 8 == 0usize); |
| 149 | |
| 150 | const _: () = assert!(std::mem::size_of::<InheritsFromBaseWithCustomAlignment>() == 64usize); |
| 151 | const _: () = assert!(std::mem::align_of::<InheritsFromBaseWithCustomAlignment>() == 64usize); |
| 152 | |
| 153 | const _: () = assert!(std::mem::size_of::<HasCustomAlignmentWithGnuAttr>() == 64usize); |
| 154 | const _: () = assert!(std::mem::align_of::<HasCustomAlignmentWithGnuAttr>() == 64usize); |