Skip to content

Commit 5a0f17e

Browse files
authored
Rollup merge of #67490 - Mark-Simulacrum:i-67371, r=Dylan-DPC
Document privacy of RangeInclusive fields Fixes #67371
2 parents 2135cc4 + 519fc84 commit 5a0f17e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/ops/range.rs

+5
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
333333
#[derive(Clone)] // not Copy -- see #27186
334334
#[stable(feature = "inclusive_range", since = "1.26.0")]
335335
pub struct RangeInclusive<Idx> {
336+
// Note that the fields here are not public to allow changing the
337+
// representation in the future; in particular, while we could plausibly
338+
// expose start/end, modifying them without changing (future/current)
339+
// private fields may lead to incorrect behavior, so we don't want to
340+
// support that mode.
336341
pub(crate) start: Idx,
337342
pub(crate) end: Idx,
338343
pub(crate) is_empty: Option<bool>,

0 commit comments

Comments
 (0)