Rollup merge of #67490 - Mark-Simulacrum:i-67371, r=Dylan-DPC

Document privacy of RangeInclusive fields

Fixes #67371
This commit is contained in:
Mazdak Farrokhzad 2019-12-21 19:07:42 +01:00 committed by GitHub
commit 5a0f17e849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,6 +333,11 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
#[derive(Clone)] // not Copy -- see #27186 #[derive(Clone)] // not Copy -- see #27186
#[stable(feature = "inclusive_range", since = "1.26.0")] #[stable(feature = "inclusive_range", since = "1.26.0")]
pub struct RangeInclusive<Idx> { 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) start: Idx,
pub(crate) end: Idx, pub(crate) end: Idx,
pub(crate) is_empty: Option<bool>, pub(crate) is_empty: Option<bool>,