You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0277]: `(dyn std::ops::FnMut() + 'static)` cannot be sent between threads safely
--> src/t_mock_derive.rs:251:17
|
251 | let _ = Box::new(mock) as Box<A + Send>;
| ^^^^^^^^^^^^^^ `(dyn std::ops::FnMut() + 'static)` cannot be sent between threads safely
|
= help: the trait `std::marker::Send` is not implemented for `(dyn std::ops::FnMut() + 'static)`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<(dyn std::ops::FnMut() + 'static)>`
= note: required because it appears within the type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>`
= note: required because it appears within the type `std::option::Option<std::boxed::Box<(dyn std::ops::FnMut() + 'static)>>`
= note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::option::Option<std::boxed::Box<(dyn std::ops::FnMut() + 'static)>>>`
= note: required because it appears within the type `<t_mock_derive::t::MockDerive as TestSuite>::send::MockMethodForA<()>`
= note: required because it appears within the type `std::option::Option<<t_mock_derive::t::MockDerive as TestSuite>::send::MockMethodForA<()>>`
= note: required because it appears within the type `<t_mock_derive::t::MockDerive as TestSuite>::send::MockA`
= note: required for the cast to the object type `dyn <t_mock_derive::t::MockDerive as TestSuite>::send::A + std::marker::Send`
The text was updated successfully, but these errors were encountered:
mock_derive cannot mock traits that are
Send
. Example:Gives this error:
The text was updated successfully, but these errors were encountered: