summaryrefslogtreecommitdiff
path: root/tests/ui/proc_macro_arc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/proc_macro_arc.rs')
-rw-r--r--tests/ui/proc_macro_arc.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/proc_macro_arc.rs b/tests/ui/proc_macro_arc.rs
new file mode 100644
index 0000000..9db3376
--- /dev/null
+++ b/tests/ui/proc_macro_arc.rs
@@ -0,0 +1,24 @@
+use std::sync::Arc;
+
+fn main() {}
+
+// Normally this is defined by the scaffolding code, manually define it for the UI test
+pub struct UniFfiTag;
+
+pub struct Foo;
+
+#[uniffi::export]
+fn make_foo() -> Arc<Foo> {
+ Arc::new(Foo)
+}
+
+mod child {
+ use std::sync::Arc;
+
+ enum Foo {}
+
+ #[uniffi::export]
+ fn take_foo(foo: Arc<Foo>) {
+ match &*foo {}
+ }
+}