-
Notifications
You must be signed in to change notification settings - Fork 628
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
FuturesUnordered has an incorrect Sync impl #2050
Comments
FuturesUnordered was previously modified to use interior mutability for the len and head_all fields using Cell, but its Sync implementation was left intact. This implementation is no longer valid, so it has been removed. Fixes rust-lang#2050.
Good catch! I'd be happy to accept a PR introducing atomics to handle this case correctly, as discussed in #2051. |
#2054 has a couple variations on a solution. There are some shortcomings to both, mostly with regards to how to deal with providing the appropriate length for iterators, so there may be another solution that's more suitable. |
IMHO it would make sense to reconsider if having Currently in |
Yes, it was not intended for |
FuturesUnordered
switched to usingCell
for interior mutability of thelen
andhead_all
fields in 47f3ccb, but it still currently retains aSync
implementation. Since there isn't any synchronization performed when these fields are modified when calling thepush
method, theSync
implementation is invalid and should be dropped.It looks like this was mentioned in #1669, but was overlooked in the actual commit.
The text was updated successfully, but these errors were encountered: