This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
unsafe allowed inside #[async]
functions
#74
Comments
Ugh this is quite problematic! Once Pin stuff lands, we can make changes to generators so that this unsafe block should be going away, but until then... cc @cramertj |
Nemo157
added a commit
to Nemo157/futures-await
that referenced
this issue
Mar 25, 2018
As of rust-lang/rust#49194 it's now unsafe to resume a generator, but safe to create an immovable generator. Fixes alexcrichton#74
Please backport this to 0.1.x while 0.2.x is still alpha.
|
See #79, this is actually about the inverse problem where you could use unsafe functions without adding an |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As an example, running this will segfault without any warnings:
while the same example with
s/async/async_move/
will fail to compile:This appears to be caused by this unhygenic
unsafe
block, I assume this has something to do with self-referential generators, but I'm hoping there's some way to fix this to avoid accidental unsafety.The text was updated successfully, but these errors were encountered: