Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [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:namespace_cc |
| 7 | #![rustfmt::skip] |
| 8 | #![feature(const_ptr_offset_from, custom_inner_attributes, negative_impls)] |
| 9 | #![allow(non_camel_case_types)] |
| 10 | #![allow(non_snake_case)] |
| 11 | |
| 12 | use ::std as rust_std; |
| 13 | use memoffset_unstable_const::offset_of; |
| 14 | |
| 15 | // Part of the Crubit project, under the Apache License v2.0 with LLVM |
| 16 | // Exceptions. See /LICENSE for license information. |
| 17 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 18 | |
| 19 | pub mod test_namespace_bindings { |
| 20 | #[repr(C)] |
| 21 | pub struct S { |
| 22 | pub i: i32, |
| 23 | } |
Rosica Dejanovska | 8283fe6 | 2022-05-09 10:04:28 -0700 | [diff] [blame] | 24 | forward_declare::unsafe_define!( |
| 25 | forward_declare::symbol!("S"), |
| 26 | crate::test_namespace_bindings::S |
| 27 | ); |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 28 | |
| 29 | impl !Unpin for S {} |
| 30 | |
| 31 | // rs_bindings_from_cc/test/golden/namespace.h;l=9 |
| 32 | // Error while generating bindings for item 'S::S': |
| 33 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
| 34 | |
| 35 | // rs_bindings_from_cc/test/golden/namespace.h;l=9 |
| 36 | // Error while generating bindings for item 'S::S': |
| 37 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
| 38 | |
| 39 | // rs_bindings_from_cc/test/golden/namespace.h;l=9 |
| 40 | // Error while generating bindings for item 'test_namespace_bindings::S::S': |
| 41 | // Parameter #0 is not supported: Unsupported type 'struct test_namespace_bindings::S &&': Unsupported type: && without lifetime |
| 42 | |
| 43 | // rs_bindings_from_cc/test/golden/namespace.h;l=9 |
| 44 | // Error while generating bindings for item 'S::operator=': |
| 45 | // Bindings for this kind of operator are not supported |
| 46 | |
| 47 | // rs_bindings_from_cc/test/golden/namespace.h;l=9 |
| 48 | // Error while generating bindings for item 'test_namespace_bindings::S::operator=': |
| 49 | // Parameter #0 is not supported: Unsupported type 'struct test_namespace_bindings::S &&': Unsupported type: && without lifetime |
| 50 | |
| 51 | /// Free comment inside namespace |
| 52 | #[inline(always)] |
Rosica Dejanovska | 8283fe6 | 2022-05-09 10:04:28 -0700 | [diff] [blame] | 53 | pub fn f(s: crate::test_namespace_bindings::S) -> i32 { |
Rosica Dejanovska | 68c11ac | 2022-05-12 03:48:59 -0700 | [diff] [blame^] | 54 | unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings1fENS_1SE(s) } |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | pub mod inner { |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 58 | #[inline(always)] |
| 59 | pub fn i() { |
Rosica Dejanovska | 68c11ac | 2022-05-12 03:48:59 -0700 | [diff] [blame^] | 60 | unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings5inner1iEv() } |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 61 | } |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | // namespace inner |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | // namespace test_namespace_bindings |
| 68 | |
Rosica Dejanovska | 8283fe6 | 2022-05-09 10:04:28 -0700 | [diff] [blame] | 69 | #[inline(always)] |
| 70 | pub fn identity(s: crate::test_namespace_bindings::S) -> crate::test_namespace_bindings::S { |
Rosica Dejanovska | 68c11ac | 2022-05-12 03:48:59 -0700 | [diff] [blame^] | 71 | unsafe { crate::detail::__rust_thunk___Z8identityN23test_namespace_bindings1SE(s) } |
Rosica Dejanovska | 8283fe6 | 2022-05-09 10:04:28 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 74 | pub mod test_namespace_bindings_reopened { |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 75 | #[inline(always)] |
| 76 | pub fn x() { |
Rosica Dejanovska | 68c11ac | 2022-05-12 03:48:59 -0700 | [diff] [blame^] | 77 | unsafe { crate::detail::__rust_thunk___ZN32test_namespace_bindings_reopened1xEv() } |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | pub mod inner { |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 81 | #[repr(C)] |
| 82 | pub struct S { |
Rosica Dejanovska | 68c11ac | 2022-05-12 03:48:59 -0700 | [diff] [blame^] | 83 | __non_field_data: [crate::rust_std::mem::MaybeUninit<u8>; 1], |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 84 | } |
| 85 | forward_declare::unsafe_define!( |
| 86 | forward_declare::symbol!("S"), |
| 87 | crate::test_namespace_bindings_reopened::inner::S |
| 88 | ); |
| 89 | |
| 90 | impl !Unpin for S {} |
| 91 | |
| 92 | // rs_bindings_from_cc/test/golden/namespace.h;l=27 |
| 93 | // Error while generating bindings for item 'S::S': |
| 94 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
| 95 | |
| 96 | // rs_bindings_from_cc/test/golden/namespace.h;l=27 |
| 97 | // Error while generating bindings for item 'S::S': |
| 98 | // Unsafe constructors (e.g. with no elided or explicit lifetimes) are intentionally not supported |
| 99 | |
| 100 | // rs_bindings_from_cc/test/golden/namespace.h;l=27 |
| 101 | // Error while generating bindings for item 'test_namespace_bindings_reopened::inner::S::S': |
| 102 | // Parameter #0 is not supported: Unsupported type 'struct test_namespace_bindings_reopened::inner::S &&': Unsupported type: && without lifetime |
| 103 | |
| 104 | // rs_bindings_from_cc/test/golden/namespace.h;l=27 |
| 105 | // Error while generating bindings for item 'S::operator=': |
| 106 | // Bindings for this kind of operator are not supported |
| 107 | |
| 108 | // rs_bindings_from_cc/test/golden/namespace.h;l=27 |
| 109 | // Error while generating bindings for item 'test_namespace_bindings_reopened::inner::S::operator=': |
| 110 | // Parameter #0 is not supported: Unsupported type 'struct test_namespace_bindings_reopened::inner::S &&': Unsupported type: && without lifetime |
| 111 | } |
| 112 | |
| 113 | // namespace inner |
| 114 | } |
| 115 | |
| 116 | // namespace test_namespace_bindings_reopened |
| 117 | |
| 118 | // namespace inner |
| 119 | |
| 120 | // namespace test_namespace_bindings_reopened |
| 121 | |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 122 | // THIRD_PARTY_CRUBIT_RS_BINDINGS_FROM_CC_TEST_GOLDEN_NAMESPACE_H_ |
| 123 | |
Rosica Dejanovska | 8283fe6 | 2022-05-09 10:04:28 -0700 | [diff] [blame] | 124 | mod detail { |
| 125 | #[allow(unused_imports)] |
| 126 | use super::*; |
| 127 | extern "C" { |
Rosica Dejanovska | 5d9faaf | 2022-05-11 04:30:04 -0700 | [diff] [blame] | 128 | #[link_name = "_ZN23test_namespace_bindings1fENS_1SE"] |
| 129 | pub(crate) fn __rust_thunk___ZN23test_namespace_bindings1fENS_1SE( |
| 130 | s: crate::test_namespace_bindings::S, |
| 131 | ) -> i32; |
| 132 | #[link_name = "_ZN23test_namespace_bindings5inner1iEv"] |
| 133 | pub(crate) fn __rust_thunk___ZN23test_namespace_bindings5inner1iEv(); |
Rosica Dejanovska | 8283fe6 | 2022-05-09 10:04:28 -0700 | [diff] [blame] | 134 | #[link_name = "_Z8identityN23test_namespace_bindings1SE"] |
| 135 | pub(crate) fn __rust_thunk___Z8identityN23test_namespace_bindings1SE( |
| 136 | s: crate::test_namespace_bindings::S, |
| 137 | ) -> crate::test_namespace_bindings::S; |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 138 | #[link_name = "_ZN32test_namespace_bindings_reopened1xEv"] |
| 139 | pub(crate) fn __rust_thunk___ZN32test_namespace_bindings_reopened1xEv(); |
Rosica Dejanovska | 8283fe6 | 2022-05-09 10:04:28 -0700 | [diff] [blame] | 140 | } |
| 141 | } |
| 142 | |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 143 | const _: () = assert!(rust_std::mem::size_of::<Option<&i32>>() == rust_std::mem::size_of::<&i32>()); |
Rosica Dejanovska | 5d9faaf | 2022-05-11 04:30:04 -0700 | [diff] [blame] | 144 | |
| 145 | const _: () = assert!(rust_std::mem::size_of::<crate::test_namespace_bindings::S>() == 4usize); |
| 146 | const _: () = assert!(rust_std::mem::align_of::<crate::test_namespace_bindings::S>() == 4usize); |
| 147 | const _: () = { |
| 148 | static_assertions::assert_not_impl_all!(crate::test_namespace_bindings::S: Copy); |
| 149 | }; |
| 150 | const _: () = { |
| 151 | static_assertions::assert_not_impl_all!(crate::test_namespace_bindings::S: Drop); |
| 152 | }; |
| 153 | const _: () = assert!(offset_of!(crate::test_namespace_bindings::S, i) * 8 == 0usize); |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 154 | |
| 155 | const _: () = assert!( |
| 156 | rust_std::mem::size_of::<crate::test_namespace_bindings_reopened::inner::S>() == 1usize |
| 157 | ); |
| 158 | const _: () = assert!( |
| 159 | rust_std::mem::align_of::<crate::test_namespace_bindings_reopened::inner::S>() == 1usize |
| 160 | ); |
| 161 | const _: () = { |
| 162 | static_assertions::assert_not_impl_all!( |
| 163 | crate::test_namespace_bindings_reopened::inner::S: Copy |
| 164 | ); |
| 165 | }; |
| 166 | const _: () = { |
| 167 | static_assertions::assert_not_impl_all!( |
| 168 | crate::test_namespace_bindings_reopened::inner::S: Drop |
| 169 | ); |
| 170 | }; |