We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b77970 commit 6611276Copy full SHA for 6611276
tests/expectations/tests/no-std.rs
@@ -0,0 +1,23 @@
1
+/* automatically generated by rust-bindgen */
2
+
3
4
+#![allow(non_snake_case)]
5
6
+#![no_std]
7
+mod libc { pub type c_int = i32; pub enum c_void {} }
8
9
+#[repr(C)]
10
+#[derive(Debug, Copy)]
11
+pub struct foo {
12
+ pub a: libc::c_int,
13
+ pub b: libc::c_int,
14
+ pub bar: *mut libc::c_void,
15
+}
16
+#[test]
17
+fn bindgen_test_layout_foo() {
18
+ assert_eq!(::core::mem::size_of::<foo>() , 16usize);
19
+ assert_eq!(::core::mem::align_of::<foo>() , 8usize);
20
21
+impl Clone for foo {
22
+ fn clone(&self) -> Self { *self }
23
tests/headers/no-std.h
@@ -0,0 +1,5 @@
+// bindgen-flags: --ctypes-prefix "libc" --use-core --raw-line "#![no_std]" --raw-line "mod libc { pub type c_int = i32; pub enum c_void {} }"
+struct foo {
+ int a, b;
+ void* bar;
+};
0 commit comments