-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Labels
A-iteratorsArea: IteratorsArea: IteratorsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
There are a few places where an Iter
implements Send
when the item/key/value traits are Sync
. The other related types (IterMut
, etc...) implement Sync
for Sync
items and Send
for Send
items.
See line 1209 in
rust/src/liballoc/collections/linked_list.rs
Lines 1202 to 1218 in 917945d
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<T: Send> Send for LinkedList<T> {} | |
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<T: Sync> Sync for LinkedList<T> {} | |
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<'a, T: Sync> Send for Iter<'a, T> {} | |
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<'a, T: Sync> Sync for Iter<'a, T> {} | |
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<'a, T: Send> Send for IterMut<'a, T> {} | |
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<'a, T: Sync> Sync for IterMut<'a, T> {} |
and also in
Lines 2650 to 2653 in 917945d
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<'a, T: Sync> Sync for Iter<'a, T> {} | |
#[stable(feature = "rust1", since = "1.0.0")] | |
unsafe impl<'a, T: Sync> Send for Iter<'a, T> {} |
as well as
rust/src/libstd/collections/hash/table.rs
Lines 916 to 917 in 917945d
unsafe impl<'a, K: Sync, V: Sync> Sync for Iter<'a, K, V> {} | |
unsafe impl<'a, K: Sync, V: Sync> Send for Iter<'a, K, V> {} |
( Noticed this pattern in hyperium/http#239 )
Metadata
Metadata
Assignees
Labels
A-iteratorsArea: IteratorsArea: IteratorsT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.