]> git.lizzy.rs Git - rust.git/commitdiff
Add doc comments mentioning unspecified behaviour upon exhaustion
authorvarkor <github@varkor.com>
Wed, 16 May 2018 20:19:17 +0000 (21:19 +0100)
committervarkor <github@varkor.com>
Thu, 17 May 2018 19:58:28 +0000 (20:58 +0100)
src/libcore/ops/range.rs

index 6f2a08999bc5cb4418405f1d77356f776c7a4a2a..7c6e2447bdb7f39b707c1c80e62f6420ca0d7e5b 100644 (file)
@@ -360,6 +360,9 @@ pub const fn new(start: Idx, end: Idx) -> Self {
     /// 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 @@ pub fn start(&self) -> &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 @@ pub fn end(&self) -> &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
     ///