Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMake resuming generators unsafe instead of the creation of immovable generators #49194
Conversation
rust-highfive
assigned
cramertj
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
label
Mar 20, 2018
estebank
changed the title
Make resuming generators unsafe instead of the creation of immovable generators. Fixes #47787
Make resuming generators unsafe instead of the creation of immovable generators
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
|
Awesome! Thanks @Zoxc. Looks like a few of the tests still need |
withoutboats
added
S-waiting-on-author
and removed
S-waiting-on-review
labels
Mar 20, 2018
Zoxc
force-pushed the
Zoxc:unsafe-generator
branch
4 times, most recently
from
496c585
to
55d73db
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
|
Travis passes now. |
| @@ -18,7 +18,7 @@ impl<T: Generator<Return = ()>> Iterator for W<T> { | |||
| type Item = T::Yield; | |||
|
|
|||
| fn next(&mut self) -> Option<Self::Item> { | |||
| match self.0.resume() { | |||
| match unsafe { self.0.resume() } { | |||
This comment has been minimized.
This comment has been minimized.
cramertj
Mar 20, 2018
•
Member
This impl isn't actually sound anymore since the iterator can move-- can you leave a comment? (I think it's fine to leave it because the Pin version will come soon, but there should probably be a note about it)
This comment has been minimized.
This comment has been minimized.
|
@bors r+ The |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-author
labels
Mar 20, 2018
Zoxc
force-pushed the
Zoxc:unsafe-generator
branch
from
55d73db
to
57896ab
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
Nice :) |
Zoxc commentedMar 20, 2018
•
edited by estebank
cc @withoutboats
Fixes #47787