summaryrefslogtreecommitdiffstats
path: root/tests/rust/box.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rust/box.rs')
-rw-r--r--tests/rust/box.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/rust/box.rs b/tests/rust/box.rs
new file mode 100644
index 0000000..6cc852c
--- /dev/null
+++ b/tests/rust/box.rs
@@ -0,0 +1,19 @@
+#[repr(C)]
+pub struct MyStruct {
+ number: Box<i32>,
+}
+
+pub struct NotReprC<T> {
+ inner: T,
+}
+
+pub type Foo = NotReprC<Box<i32>>;
+
+#[no_mangle]
+pub extern "C" fn root(a: &Foo, with_box: &MyStruct) {}
+
+#[no_mangle]
+pub extern "C" fn drop_box(x: Box<i32>) {}
+
+#[no_mangle]
+pub extern "C" fn drop_box_opt(x: Option<Box<i32>>) {}