forked from mozilla/uniffi-rs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure structs and traits exposed via procmacros also staticallly ass…
…ert Send+Sync (mozilla#1727)
- Loading branch information
Showing
8 changed files
with
113 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 40 additions & 12 deletions
52
fixtures/uitests/tests/ui/interface_trait_not_sync_and_send.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,55 @@ | ||
error[E0277]: `dyn Trait` cannot be shared between threads safely | ||
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs | ||
| | ||
| uniffi::deps::static_assertions::assert_impl_all!(dyn r#Trait: Sync, Send); | ||
| ^^^^^^^^^^^ `dyn Trait` cannot be shared between threads safely | ||
| ::uniffi::expand_trait_interface_support!(r#Trait); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Trait` cannot be shared between threads safely | ||
| | ||
= help: the trait `Sync` is not implemented for `dyn Trait` | ||
note: required by a bound in `assert_impl_all` | ||
note: required by a bound in `_::{closure#0}::assert_impl_all` | ||
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs | ||
| | ||
| uniffi::deps::static_assertions::assert_impl_all!(dyn r#Trait: Sync, Send); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | ||
= note: this error originates in the macro `uniffi::deps::static_assertions::assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
| ::uniffi::expand_trait_interface_support!(r#Trait); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | ||
= note: this error originates in the macro `::uniffi::expand_trait_interface_support` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: `dyn Trait` cannot be sent between threads safely | ||
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs | ||
| | ||
| uniffi::deps::static_assertions::assert_impl_all!(dyn r#Trait: Sync, Send); | ||
| ^^^^^^^^^^^ `dyn Trait` cannot be sent between threads safely | ||
| ::uniffi::expand_trait_interface_support!(r#Trait); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Trait` cannot be sent between threads safely | ||
| | ||
= help: the trait `Send` is not implemented for `dyn Trait` | ||
note: required by a bound in `assert_impl_all` | ||
note: required by a bound in `_::{closure#0}::assert_impl_all` | ||
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs | ||
| | ||
| uniffi::deps::static_assertions::assert_impl_all!(dyn r#Trait: Sync, Send); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | ||
= note: this error originates in the macro `uniffi::deps::static_assertions::assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
| ::uniffi::expand_trait_interface_support!(r#Trait); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | ||
= note: this error originates in the macro `::uniffi::expand_trait_interface_support` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: `dyn ProcMacroTrait` cannot be shared between threads safely | ||
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1 | ||
| | ||
11 | #[uniffi::export] | ||
| ^^^^^^^^^^^^^^^^^ `dyn ProcMacroTrait` cannot be shared between threads safely | ||
| | ||
= help: the trait `Sync` is not implemented for `dyn ProcMacroTrait` | ||
note: required by a bound in `_::{closure#0}::assert_impl_all` | ||
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1 | ||
| | ||
11 | #[uniffi::export] | ||
| ^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | ||
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: `dyn ProcMacroTrait` cannot be sent between threads safely | ||
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1 | ||
| | ||
11 | #[uniffi::export] | ||
| ^^^^^^^^^^^^^^^^^ `dyn ProcMacroTrait` cannot be sent between threads safely | ||
| | ||
= help: the trait `Send` is not implemented for `dyn ProcMacroTrait` | ||
note: required by a bound in `_::{closure#0}::assert_impl_all` | ||
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1 | ||
| | ||
11 | #[uniffi::export] | ||
| ^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all` | ||
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters