diff options
Diffstat (limited to 'third_party/rust/uniffi/tests/ui/proc_macro_arc.rs')
-rw-r--r-- | third_party/rust/uniffi/tests/ui/proc_macro_arc.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/third_party/rust/uniffi/tests/ui/proc_macro_arc.rs b/third_party/rust/uniffi/tests/ui/proc_macro_arc.rs new file mode 100644 index 0000000000..9db3376594 --- /dev/null +++ b/third_party/rust/uniffi/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 {} + } +} |