From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- third_party/rust/uniffi/tests/ui/proc_macro_arc.rs | 25 ++++++++++++++++++++++ .../rust/uniffi/tests/ui/proc_macro_arc.stderr | 22 +++++++++++++++++++ .../rust/uniffi/tests/ui/version_mismatch.rs | 4 ++++ .../rust/uniffi/tests/ui/version_mismatch.stderr | 7 ++++++ 4 files changed, 58 insertions(+) create mode 100644 third_party/rust/uniffi/tests/ui/proc_macro_arc.rs create mode 100644 third_party/rust/uniffi/tests/ui/proc_macro_arc.stderr create mode 100644 third_party/rust/uniffi/tests/ui/version_mismatch.rs create mode 100644 third_party/rust/uniffi/tests/ui/version_mismatch.stderr (limited to 'third_party/rust/uniffi/tests/ui') 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..bdffc020e0 --- /dev/null +++ b/third_party/rust/uniffi/tests/ui/proc_macro_arc.rs @@ -0,0 +1,25 @@ +use std::sync::Arc; + +fn main() {} + +pub struct Foo; + +#[uniffi::export] +fn make_foo() -> Arc { + Arc::new(Foo) +} + +mod child { + use std::sync::Arc; + + enum Foo {} + + #[uniffi::export] + fn take_foo(foo: Arc) { + match &*foo {} + } +} + +mod uniffi_types { + pub use super::Foo; +} diff --git a/third_party/rust/uniffi/tests/ui/proc_macro_arc.stderr b/third_party/rust/uniffi/tests/ui/proc_macro_arc.stderr new file mode 100644 index 0000000000..8bddbc1493 --- /dev/null +++ b/third_party/rust/uniffi/tests/ui/proc_macro_arc.stderr @@ -0,0 +1,22 @@ +error[E0271]: type mismatch resolving ` as child::_::_::{closure#0}::TypeEq>::This == Arc` + --> tests/ui/proc_macro_arc.rs:18:22 + | +18 | fn take_foo(foo: Arc) { + | ^^^ type mismatch resolving ` as child::_::_::{closure#0}::TypeEq>::This == Arc` + | +note: expected this to be `Arc` + --> tests/ui/proc_macro_arc.rs:18:22 + | +18 | fn take_foo(foo: Arc) { + | ^^^ + = note: expected struct `Arc` + found struct `Arc` +note: required by a bound in `child::_::_::{closure#0}::assert_type_eq_all` + --> tests/ui/proc_macro_arc.rs:18:22 + | +18 | fn take_foo(foo: Arc) { + | ^^^ + | | + | required by a bound in this + | required by this bound in `child::_::_::{closure#0}::assert_type_eq_all` + = note: this error originates in the macro `::uniffi::deps::static_assertions::assert_type_eq_all` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/third_party/rust/uniffi/tests/ui/version_mismatch.rs b/third_party/rust/uniffi/tests/ui/version_mismatch.rs new file mode 100644 index 0000000000..6a7edb891d --- /dev/null +++ b/third_party/rust/uniffi/tests/ui/version_mismatch.rs @@ -0,0 +1,4 @@ +// This should fail with a version mismatch. +uniffi::assert_compatible_version!("0.0.1"); // An error message would go here. + +fn main() {} diff --git a/third_party/rust/uniffi/tests/ui/version_mismatch.stderr b/third_party/rust/uniffi/tests/ui/version_mismatch.stderr new file mode 100644 index 0000000000..dde4a7a040 --- /dev/null +++ b/third_party/rust/uniffi/tests/ui/version_mismatch.stderr @@ -0,0 +1,7 @@ +error[E0080]: evaluation of constant value failed + --> tests/ui/version_mismatch.rs:2:1 + | +2 | uniffi::assert_compatible_version!("0.0.1"); // An error message would go here. + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow + | + = note: this error originates in the macro `uniffi::deps::static_assertions::const_assert` (in Nightly builds, run with -Z macro-backtrace for more info) -- cgit v1.2.3