-
-
Notifications
You must be signed in to change notification settings - Fork 334
fix Send / Sync (typos) #239
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
Conversation
@@ -2024,7 +2024,7 @@ mod tests { | |||
|
|||
#[test] | |||
fn test_bounds() { | |||
fn check_bounds<T: Sync + Send>() {} | |||
fn check_bounds<T: Send + Sync>() {} |
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.
every other usage is in Send + Sync
order.
How does HashMap in std implement Send and Sync bounds? |
I actually don’t think that Iter can be Send because it holds a reference to the map. If I recall those bounds were intentional. |
Hi @carllerche. I'm not sure if Iter should be Send or not. But if that's the case, wouldn't Drain, IterMut, and ValueIterMut have the same bounds? Lines 2002 to 2003 in 8d45bd5
Lines 2102 to 2103 in 8d45bd5
Lines 2531 to 2532 in 8d45bd5
... Lines 1941 to 1942 in 8d45bd5
|
@carllerche you're right! This pattern is also in the rust core libraries. Still feels like a typo (and if not, that it needs a nice fat comment). |
@carllerche You're right, the pattern of sync-implies-ref-is-send is deep in the rust type system. |
Would you mind adding a comment including your findings for the next person? |
Well, I think I understand why If a good explanation appears in rust#53625, I'll can reopen this with a nice comment. |
I think I found a couple copy-paste errors.