Skip to content

Commit ff0f00d

Browse files
committed
Add doc comments mentioning unspecified behaviour upon exhaustion
1 parent 1b3ecbc commit ff0f00d

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
@@ -360,6 +360,9 @@ impl<Idx> RangeInclusive<Idx> {
360360
/// whether the inclusive range is empty, use the [`is_empty()`] method
361361
/// instead of comparing `start() > end()`.
362362
///
363+
/// Note: the value returned by this method is unspecified after the range
364+
/// has been iterated to exhaustion.
365+
///
363366
/// [`end()`]: #method.end
364367
/// [`is_empty()`]: #method.is_empty
365368
///
@@ -381,6 +384,9 @@ impl<Idx> RangeInclusive<Idx> {
381384
/// whether the inclusive range is empty, use the [`is_empty()`] method
382385
/// instead of comparing `start() > end()`.
383386
///
387+
/// Note: the value returned by this method is unspecified after the range
388+
/// has been iterated to exhaustion.
389+
///
384390
/// [`start()`]: #method.start
385391
/// [`is_empty()`]: #method.is_empty
386392
///
@@ -395,7 +401,10 @@ impl<Idx> RangeInclusive<Idx> {
395401
&self.end
396402
}
397403

398-
/// Destructures the RangeInclusive into (lower bound, upper (inclusive) bound).
404+
/// Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound).
405+
///
406+
/// Note: the value returned by this method is unspecified after the range
407+
/// has been iterated to exhaustion.
399408
///
400409
/// # Examples
401410
///

0 commit comments

Comments
 (0)