diff --git a/tests/ui/unpin_impl.rs b/tests/ui/unpin_impl.rs new file mode 100644 index 000000000..129fcb11d --- /dev/null +++ b/tests/ui/unpin_impl.rs @@ -0,0 +1,10 @@ +#[cxx::bridge] +mod ffi { + extern "C++" { + type Opaque; + } +} + +impl Unpin for ffi::Opaque {} + +fn main() {} diff --git a/tests/ui/unpin_impl.stderr b/tests/ui/unpin_impl.stderr new file mode 100644 index 000000000..18099bb66 --- /dev/null +++ b/tests/ui/unpin_impl.stderr @@ -0,0 +1,20 @@ +error[E0282]: type annotations needed + --> tests/ui/unpin_impl.rs:1:1 + | +1 | #[cxx::bridge] + | ^^^^^^^^^^^^^^ cannot infer type of the type parameter `Self` declared on the trait `__AmbiguousIfImpl` + | + = note: this error originates in the attribute macro `cxx::bridge` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0283]: type annotations needed + --> tests/ui/unpin_impl.rs:1:1 + | +1 | #[cxx::bridge] + | ^^^^^^^^^^^^^^ cannot infer type of the type parameter `Self` declared on the trait `__AmbiguousIfImpl` + | +note: multiple `impl`s satisfying `ffi::Opaque: __AmbiguousIfImpl<_>` found + --> tests/ui/unpin_impl.rs:1:1 + | +1 | #[cxx::bridge] + | ^^^^^^^^^^^^^^ + = note: this error originates in the attribute macro `cxx::bridge` (in Nightly builds, run with -Z macro-backtrace for more info)