blob: 08155922b774c2dd71c3178a7631bae7cd6890ef [file] [log] [blame]
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -07001// 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
12use ::std as rust_std;
13use 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
19pub mod test_namespace_bindings {
20 #[repr(C)]
21 pub struct S {
22 pub i: i32,
23 }
Rosica Dejanovska8283fe62022-05-09 10:04:28 -070024 forward_declare::unsafe_define!(
25 forward_declare::symbol!("S"),
26 crate::test_namespace_bindings::S
27 );
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -070028
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 Dejanovska8283fe62022-05-09 10:04:28 -070053 pub fn f(s: crate::test_namespace_bindings::S) -> i32 {
Rosica Dejanovska68c11ac2022-05-12 03:48:59 -070054 unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings1fENS_1SE(s) }
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -070055 }
56
57 pub mod inner {
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -070058 #[inline(always)]
59 pub fn i() {
Rosica Dejanovska68c11ac2022-05-12 03:48:59 -070060 unsafe { crate::detail::__rust_thunk___ZN23test_namespace_bindings5inner1iEv() }
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -070061 }
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -070062 }
63
64 // namespace inner
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -070065}
66
67// namespace test_namespace_bindings
68
Rosica Dejanovska8283fe62022-05-09 10:04:28 -070069#[inline(always)]
70pub fn identity(s: crate::test_namespace_bindings::S) -> crate::test_namespace_bindings::S {
Rosica Dejanovska68c11ac2022-05-12 03:48:59 -070071 unsafe { crate::detail::__rust_thunk___Z8identityN23test_namespace_bindings1SE(s) }
Rosica Dejanovska8283fe62022-05-09 10:04:28 -070072}
73
Rosica Dejanovska6efd17f2022-05-11 08:09:57 -070074pub mod test_namespace_bindings_reopened {
Rosica Dejanovska6efd17f2022-05-11 08:09:57 -070075 #[inline(always)]
76 pub fn x() {
Rosica Dejanovska68c11ac2022-05-12 03:48:59 -070077 unsafe { crate::detail::__rust_thunk___ZN32test_namespace_bindings_reopened1xEv() }
Rosica Dejanovska6efd17f2022-05-11 08:09:57 -070078 }
79
80 pub mod inner {
Rosica Dejanovska6efd17f2022-05-11 08:09:57 -070081 #[repr(C)]
82 pub struct S {
Rosica Dejanovska68c11ac2022-05-12 03:48:59 -070083 __non_field_data: [crate::rust_std::mem::MaybeUninit<u8>; 1],
Rosica Dejanovska6efd17f2022-05-11 08:09:57 -070084 }
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 Dejanovskadd9a9032022-04-12 07:34:41 -0700122// THIRD_PARTY_CRUBIT_RS_BINDINGS_FROM_CC_TEST_GOLDEN_NAMESPACE_H_
123
Rosica Dejanovska8283fe62022-05-09 10:04:28 -0700124mod detail {
125 #[allow(unused_imports)]
126 use super::*;
127 extern "C" {
Rosica Dejanovska5d9faaf2022-05-11 04:30:04 -0700128 #[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 Dejanovska8283fe62022-05-09 10:04:28 -0700134 #[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 Dejanovska6efd17f2022-05-11 08:09:57 -0700138 #[link_name = "_ZN32test_namespace_bindings_reopened1xEv"]
139 pub(crate) fn __rust_thunk___ZN32test_namespace_bindings_reopened1xEv();
Rosica Dejanovska8283fe62022-05-09 10:04:28 -0700140 }
141}
142
Rosica Dejanovskadd9a9032022-04-12 07:34:41 -0700143const _: () = assert!(rust_std::mem::size_of::<Option<&i32>>() == rust_std::mem::size_of::<&i32>());
Rosica Dejanovska5d9faaf2022-05-11 04:30:04 -0700144
145const _: () = assert!(rust_std::mem::size_of::<crate::test_namespace_bindings::S>() == 4usize);
146const _: () = assert!(rust_std::mem::align_of::<crate::test_namespace_bindings::S>() == 4usize);
147const _: () = {
148 static_assertions::assert_not_impl_all!(crate::test_namespace_bindings::S: Copy);
149};
150const _: () = {
151 static_assertions::assert_not_impl_all!(crate::test_namespace_bindings::S: Drop);
152};
153const _: () = assert!(offset_of!(crate::test_namespace_bindings::S, i) * 8 == 0usize);
Rosica Dejanovska6efd17f2022-05-11 08:09:57 -0700154
155const _: () = assert!(
156 rust_std::mem::size_of::<crate::test_namespace_bindings_reopened::inner::S>() == 1usize
157);
158const _: () = assert!(
159 rust_std::mem::align_of::<crate::test_namespace_bindings_reopened::inner::S>() == 1usize
160);
161const _: () = {
162 static_assertions::assert_not_impl_all!(
163 crate::test_namespace_bindings_reopened::inner::S: Copy
164 );
165};
166const _: () = {
167 static_assertions::assert_not_impl_all!(
168 crate::test_namespace_bindings_reopened::inner::S: Drop
169 );
170};