Skip to content

Commit 04483c8

Browse files
committed
Remove Self: Sized bound on Iterator::nth.
This changes the signature of nth but can't break any existing code because: 1. nth can currently only be overridden on Sized structs. 2. Extra `Self: Sized` constraints on methods in impls on Sized structs are no-ops.
1 parent 1299ef7 commit 04483c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub trait Iterator {
160160
/// ```
161161
#[inline]
162162
#[stable(feature = "rust1", since = "1.0.0")]
163-
fn nth(&mut self, mut n: usize) -> Option<Self::Item> where Self: Sized {
163+
fn nth(&mut self, mut n: usize) -> Option<Self::Item> {
164164
for x in self {
165165
if n == 0 { return Some(x) }
166166
n -= 1;

0 commit comments

Comments
 (0)