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]: `std::rc::Rc<std::cell::RefCell<std::collections::HashMap<(), fn(())>>>` cannot be sent between threads safely
--> src/t_double.rs:388:17
|
388 | let _ = Box::new(mock) as Box<A + Send>;
| ^^^^^^^^^^^^^^ `std::rc::Rc<std::cell::RefCell<std::collections::HashMap<(), fn(())>>>` cannot be sent between threads safely
|
= help: within `<t_double::t::MockDouble as TestSuite>::send::MockA`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::RefCell<std::collections::HashMap<(), fn(())>>>`
= note: required because it appears within the type `double::Mock<(), ()>`
= note: required because it appears within the type `<t_double::t::MockDouble as TestSuite>::send::MockA`
= note: required for the cast to the object type `dyn <t_double::t::MockDouble as TestSuite>::send::A + std::marker::Send`
The text was updated successfully, but these errors were encountered:
Ack. I think it should be possible to support this. My initial thinking is to simply every private member variable of the generated mock struct in an Arc<Mutex<T>>. This makes the generated mock implementation more complex, but means threaded code can use mocks too.
Progress has been made. I have WIP (work in progress) branch that is mostly working. I plan to finish this feature and deploy it to a new version of the double crate next weekend.
Double cannot mock a trait that must be
Send
. Example:gives the following error:
The text was updated successfully, but these errors were encountered: