Skip to content

Remove two unsafe impls from iter::Peekable #22898

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

Merged
merged 1 commit into from
Mar 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ use num::{ToPrimitive, Int};
use ops::{Add, Deref, FnMut};
use option::Option;
use option::Option::{Some, None};
use marker::{Send, Sized, Sync};
use marker::Sized;
use usize;

/// An interface for dealing with "external iterators". These types of iterators
Expand Down Expand Up @@ -1783,10 +1783,6 @@ pub struct Peekable<I: Iterator> {
peeked: Option<I::Item>,
}

// FIXME: after #22828 being fixed, the following unsafe impl should be removed
unsafe impl<I: Iterator> Sync for Peekable<I> where I: Sync, I::Item: Sync {}
unsafe impl<I: Iterator> Send for Peekable<I> where I: Send, I::Item: Send {}

impl<I: Iterator + Clone> Clone for Peekable<I> where I::Item: Clone {
fn clone(&self) -> Peekable<I> {
Peekable {
Expand Down