Add unsafe Send and Sync impls to VecDeque's Drain<T>
This commit is contained in:
parent
45be6fc4d7
commit
493355d8e9
@ -1800,6 +1800,9 @@ pub struct Drain<'a, T: 'a> {
|
||||
deque: *mut VecDeque<T>,
|
||||
}
|
||||
|
||||
unsafe impl<'a, T: Sync> Sync for Drain<'a, T> {}
|
||||
unsafe impl<'a, T: Send> Send for Drain<'a, T> {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<'a, T: 'a> Drop for Drain<'a, T> {
|
||||
fn drop(&mut self) {
|
||||
|
@ -93,7 +93,8 @@ fn from_usize(v: usize) -> Foo {
|
||||
}
|
||||
all_sync_send!(EnumSet::<Foo>::new(), iter);
|
||||
|
||||
all_sync_send!(VecDeque::<usize>::new(), iter, iter_mut, drain, into_iter);
|
||||
all_sync_send!(VecDeque::<usize>::new(), iter, iter_mut, into_iter);
|
||||
is_sync_send!(VecDeque::<usize>::new(), drain(..));
|
||||
|
||||
all_sync_send!(Vec::<usize>::new(), into_iter);
|
||||
is_sync_send!(Vec::<usize>::new(), drain(..));
|
||||
|
Loading…
Reference in New Issue
Block a user