Skip to content

Commit 2b60207

Browse files
committed
Auto merge of #32592 - tbu-:pr_range_from_overflow, r=alexcrichton
Add a note about overflowing in the `RangeFrom` iterator
2 parents 35dca7f + 6acd90f commit 2b60207

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/ops.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,11 @@ impl<Idx: PartialOrd<Idx>> Range<Idx> {
15391539
///
15401540
/// See the [`contains()`](#method.contains) method for its characterization.
15411541
///
1542+
/// Note: Currently, no overflow checking is done for the iterator
1543+
/// implementation; if you use an integer range and the integer overflows, it
1544+
/// might panic in debug mode or create an endless loop in release mode. This
1545+
/// overflow behavior might change in the future.
1546+
///
15421547
/// # Examples
15431548
///
15441549
/// ```

0 commit comments

Comments
 (0)