Skip to content

Commit 667734e

Browse files
committed
Fix the <RangeFrom<A> as Iterator>::count
1 parent ba134df commit 667734e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/iter/range.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ impl<A: Step> Iterator for ops::RangeFrom<A> where
329329
(usize::MAX, None)
330330
}
331331

332-
#[inline]
332+
#[cold]
333333
fn count(self) -> usize {
334-
usize::MAX
334+
panic!("Iterator::count on a `x..` will overflow")
335335
}
336336

337337
#[inline]

0 commit comments

Comments
 (0)