fix Send / Sync (typos) - #239
Conversation
| #[test] | ||
| fn test_bounds() { | ||
| fn check_bounds<T: Sync + Send>() {} | ||
| fn check_bounds<T: Send + Sync>() {} |
There was a problem hiding this comment.
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.