diff --git a/library/core/src/ops/range.rs b/library/core/src/ops/range.rs index 19830365faa32..d81279cb56be3 100644 --- a/library/core/src/ops/range.rs +++ b/library/core/src/ops/range.rs @@ -56,6 +56,10 @@ impl fmt::Debug for RangeFull { /// The range `start..end` contains all values with `start <= x < end`. /// It is empty if `start >= end`. /// +/// Note that this type is not suited to represent all possible ranges. For example, `Range` +/// cannot represent the range that covers all of `u8`. Use [`(Bound, Bound)`][Bound] if you +/// need a type that can store an arbitrary range. +/// /// # Examples /// /// The `start..end` syntax is a `Range`: diff --git a/library/core/src/range.rs b/library/core/src/range.rs index 81f4b2ce78c9c..ea4ac96179981 100644 --- a/library/core/src/range.rs +++ b/library/core/src/range.rs @@ -48,6 +48,10 @@ pub use crate::ops::{RangeFull, RangeTo}; /// The `Range` contains all values with `start <= x < end`. /// It is empty if `start >= end`. /// +/// Note that this type is not suited to represent all possible ranges. For example, `Range` +/// cannot represent the range that covers all of `u8`. Use [`(Bound, Bound)`][Bound] if you +/// need a type that can store an arbitrary range. +/// /// # Examples /// /// ```