summaryrefslogtreecommitdiffstats
path: root/tests/rust/must_use.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rust/must_use.rs')
-rw-r--r--tests/rust/must_use.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/rust/must_use.rs b/tests/rust/must_use.rs
new file mode 100644
index 0000000..6b2034f
--- /dev/null
+++ b/tests/rust/must_use.rs
@@ -0,0 +1,18 @@
+
+#[repr(C)]
+#[must_use]
+pub struct OwnedPtr<T> {
+ ptr: *mut T,
+}
+
+#[repr(C, u8)]
+#[must_use]
+pub enum MaybeOwnedPtr<T> {
+ Owned(*mut T),
+ None,
+}
+
+#[no_mangle]
+#[must_use]
+pub extern "C" fn maybe_consume(input: OwnedPtr<i32>) -> MaybeOwnedPtr<i32> {
+}