Why does this compile? (Possible unsoundness?) #4597
Unanswered
SUPERCILEX
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It's only an issue once you actually spawn it on a runtime on which it can be moved across threads. So, the error will happen at the If you only use it from your |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Version
tokio v1.17.0
rustc 1.61.0-nightly (76d770ac2 2022-04-02)
Description
I'm probably missing something, but I feel like this shouldn't compile.
ThreadRng
is notSend
so shouldn't it fail to cross theawait
point? I thought you could end up on any thread after hitting anawait
which would break theThreadRng
.Beta Was this translation helpful? Give feedback.
All reactions