about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-05-16 21:19:17 +0100
committervarkor <github@varkor.com>2018-05-17 20:58:28 +0100
commitff0f00d3182cd604d2d40ea0fe75a4bca407c6b9 (patch)
treef9973b1a36a40c0cdac2aa1932efb3544a898cd0 /src/libcore
parent1b3ecbcebb38e06495819324f2a67f1d0eb24a23 (diff)
downloadrust-ff0f00d3182cd604d2d40ea0fe75a4bca407c6b9.tar.gz
rust-ff0f00d3182cd604d2d40ea0fe75a4bca407c6b9.zip
Add doc comments mentioning unspecified behaviour upon exhaustion
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/ops/range.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libcore/ops/range.rs b/src/libcore/ops/range.rs
index 6f2a08999bc..7c6e2447bdb 100644
--- a/src/libcore/ops/range.rs
+++ b/src/libcore/ops/range.rs
@@ -360,6 +360,9 @@ impl<Idx> RangeInclusive<Idx> {
     /// whether the inclusive range is empty, use the [`is_empty()`] method
     /// instead of comparing `start() > end()`.
     ///
+    /// Note: the value returned by this method is unspecified after the range
+    /// has been iterated to exhaustion.
+    ///
     /// [`end()`]: #method.end
     /// [`is_empty()`]: #method.is_empty
     ///
@@ -381,6 +384,9 @@ impl<Idx> RangeInclusive<Idx> {
     /// whether the inclusive range is empty, use the [`is_empty()`] method
     /// instead of comparing `start() > end()`.
     ///
+    /// Note: the value returned by this method is unspecified after the range
+    /// has been iterated to exhaustion.
+    ///
     /// [`start()`]: #method.start
     /// [`is_empty()`]: #method.is_empty
     ///
@@ -395,7 +401,10 @@ impl<Idx> RangeInclusive<Idx> {
         &self.end
     }
 
-    /// Destructures the RangeInclusive into (lower bound, upper (inclusive) bound).
+    /// Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound).
+    ///
+    /// Note: the value returned by this method is unspecified after the range
+    /// has been iterated to exhaustion.
     ///
     /// # Examples
     ///