-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Send from ValueDrain iterator #361
Conversation
8ee74df
to
cfc1853
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think this necessitates an 0.2 release, given
While technically a breaking change, it's expected to not affect anyone, and is the least-bad solution.
The point is to fix technically unsound behavior, without forcing user's to deal with all the other breaking changes. |
yeah, i just wasn't sure if it was a concern that this is technically a semver violation. seems fine to me 👍 |
What was the reason to opt for this instead of move values eagerly into the iterator? |
Moving them eagerly adds a cost of allocation even if you're not going to use them, just to save a super obscure case. |
@seanmonstar it could be "optimized" to be a small vec, then the allocation is avoided in most cases. |
Is all that fiddling worth not making this change? Do we expect even a single person to be sending |
Making it |
Bleck, gross. I've open #362 with a different solution. |
As noted in #355, the
ValueDrain
iterator has un-synchronized mutation of theextra_values
Vec
, and using aDrain
, a user can get multipleValueDrain
s at the same time and use them in scoped threads.This change removes the
Send
andSync
traits fromValueDrain
. While technically a breaking change, it's expected to not affect anyone, and is the least-bad solution.