Skip to content

Commit

Permalink
Document privacy of RangeInclusive fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Dec 21, 2019
1 parent c64eecf commit 519fc84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libcore/ops/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,11 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
#[derive(Clone)] // not Copy -- see #27186
#[stable(feature = "inclusive_range", since = "1.26.0")]
pub struct RangeInclusive<Idx> {
// Note that the fields here are not public to allow changing the
// representation in the future; in particular, while we could plausibly
// expose start/end, modifying them without changing (future/current)
// private fields may lead to incorrect behavior, so we don't want to
// support that mode.
pub(crate) start: Idx,
pub(crate) end: Idx,
pub(crate) is_empty: Option<bool>,
Expand Down

0 comments on commit 519fc84

Please sign in to comment.