diff options
| author | Mark Simulacrum <mark.simulacrum@gmail.com> | 2017-05-31 10:52:48 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-31 10:52:48 -0600 |
| commit | b62eb7fed8b1ac73281b5b545ffa5137d9027d81 (patch) | |
| tree | 366619db469fb6d6f9297711f9e3766c21f33015 /src/libcore/iter/iterator.rs | |
| parent | 0daa27f3c2ca0d19fbe41093f57375988791e5be (diff) | |
| parent | 265dce66b6b1181f4b955032b742c702c753f6c8 (diff) | |
Rollup merge of #42315 - scottmcm:rangefrom-sizehint, r=alexcrichton
RangeFrom should have an infinite size_hint Before, ```rust (0..).take(4).size_hint() == (0, Some(4)) ``` With this change, ```rust (0..).take(4).size_hint() == (4, Some(4)) ```
Diffstat (limited to 'src/libcore/iter/iterator.rs')
| -rw-r--r-- | src/libcore/iter/iterator.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 77cbdb98c83..85149a0f570 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -130,9 +130,10 @@ pub trait Iterator { /// /// ``` /// // an infinite iterator has no upper bound + /// // and the maximum possible lower bound /// let iter = 0..; /// - /// assert_eq!((0, None), iter.size_hint()); + /// assert_eq!((usize::max_value(), None), iter.size_hint()); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] |
