Skip to content

Commit 2d1afbd

Browse files
varkorpietroalbini
authored andcommitted
Add doc comments mentioning unspecified behaviour upon exhaustion
1 parent cf2b1c1 commit 2d1afbd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/libcore/ops/range.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ impl<Idx> RangeInclusive<Idx> {
370370
/// whether the inclusive range is empty, use the [`is_empty()`] method
371371
/// instead of comparing `start() > end()`.
372372
///
373+
/// Note: the value returned by this method is unspecified after the range
374+
/// has been iterated to exhaustion.
375+
///
373376
/// [`end()`]: #method.end
374377
/// [`is_empty()`]: #method.is_empty
375378
///
@@ -391,6 +394,9 @@ impl<Idx> RangeInclusive<Idx> {
391394
/// whether the inclusive range is empty, use the [`is_empty()`] method
392395
/// instead of comparing `start() > end()`.
393396
///
397+
/// Note: the value returned by this method is unspecified after the range
398+
/// has been iterated to exhaustion.
399+
///
394400
/// [`start()`]: #method.start
395401
/// [`is_empty()`]: #method.is_empty
396402
///
@@ -405,7 +411,10 @@ impl<Idx> RangeInclusive<Idx> {
405411
&self.end
406412
}
407413

408-
/// Destructures the RangeInclusive into (lower bound, upper (inclusive) bound).
414+
/// Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound).
415+
///
416+
/// Note: the value returned by this method is unspecified after the range
417+
/// has been iterated to exhaustion.
409418
///
410419
/// # Examples
411420
///

0 commit comments

Comments
 (0)