summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-05-16 21:19:17 +0100
committerPietro Albini <pietro@pietroalbini.org>2018-05-21 15:56:33 +0200
commit2d1afbd6b09e0b7418dfeeccd2236d715e96c14f (patch)
treed3672d0cb6ba940c2e73e3d27969b3415ef86922 /src
parentcf2b1c1b3eded5d6d8f84e52bc9eccad051dd5bf (diff)
downloadrust-2d1afbd6b09e0b7418dfeeccd2236d715e96c14f.tar.gz
rust-2d1afbd6b09e0b7418dfeeccd2236d715e96c14f.zip
Add doc comments mentioning unspecified behaviour upon exhaustion
Diffstat (limited to 'src')
-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 2664e18a93c..e542f5f60fc 100644
--- a/src/libcore/ops/range.rs
+++ b/src/libcore/ops/range.rs
@@ -370,6 +370,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
     ///
@@ -391,6 +394,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
     ///
@@ -405,7 +411,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
     ///