coio-rs
coio-rs copied to clipboard
Migrating a coroutine to another thread may move `!Send` object between threads
If I understand it correctly, the coroutines here can move from thread to thread.
Now imagine I have something that is not Send
for whatever reason. And I don't mean something like Rc
(which could cause havoc if I put it into TLS, but that's another issue), but something like Zero-MQ socket which is promised to crash the whole application if ever touched from a different thread. But it is on the stack, so it passes all compile time checks.
Moving the coroutine to another thread would now cause an UB while the user used only safe Rust.
Well, yes, this is a problem.