mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Add doc comments mentioning unspecified behaviour upon exhaustion
This commit is contained in:
@@ -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
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user