Skip to content

stabilize collections_range (closes #30877) #44564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ mod std {
/// `Bound`s are range endpoints:
///
/// ```
/// #![feature(collections_range)]
///
/// use std::collections::range::RangeArgument;
/// use std::collections::Bound::*;
///
Expand Down
12 changes: 7 additions & 5 deletions src/liballoc/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![unstable(feature = "collections_range",
reason = "waiting for dust to settle on inclusive ranges",
issue = "30877")]

//! Range syntax.

Expand All @@ -19,6 +16,7 @@ use Bound::{self, Excluded, Included, Unbounded};

/// `RangeArgument` is implemented by Rust's built-in range types, produced
/// by range syntax like `..`, `a..`, `..b` or `c..d`.
#[stable(feature = "collections_range", since = "1.22.0")]
pub trait RangeArgument<T: ?Sized> {
/// Start index bound.
///
Expand All @@ -28,7 +26,6 @@ pub trait RangeArgument<T: ?Sized> {
///
/// ```
/// #![feature(alloc)]
/// #![feature(collections_range)]
///
/// extern crate alloc;
///
Expand All @@ -40,6 +37,7 @@ pub trait RangeArgument<T: ?Sized> {
/// assert_eq!((3..10).start(), Included(&3));
/// # }
/// ```
#[stable(feature = "collections_range", since = "1.22.0")]
fn start(&self) -> Bound<&T>;

/// End index bound.
Expand All @@ -50,7 +48,6 @@ pub trait RangeArgument<T: ?Sized> {
///
/// ```
/// #![feature(alloc)]
/// #![feature(collections_range)]
///
/// extern crate alloc;
///
Expand All @@ -62,11 +59,13 @@ pub trait RangeArgument<T: ?Sized> {
/// assert_eq!((3..10).end(), Excluded(&10));
/// # }
/// ```
#[stable(feature = "collections_range", since = "1.22.0")]
fn end(&self) -> Bound<&T>;
}

// FIXME add inclusive ranges to RangeArgument

#[stable(feature = "collections_range", since = "1.22.0")]
impl<T: ?Sized> RangeArgument<T> for RangeFull {
fn start(&self) -> Bound<&T> {
Unbounded
Expand All @@ -76,6 +75,7 @@ impl<T: ?Sized> RangeArgument<T> for RangeFull {
}
}

#[stable(feature = "collections_range", since = "1.22.0")]
impl<T> RangeArgument<T> for RangeFrom<T> {
fn start(&self) -> Bound<&T> {
Included(&self.start)
Expand All @@ -85,6 +85,7 @@ impl<T> RangeArgument<T> for RangeFrom<T> {
}
}

#[stable(feature = "collections_range", since = "1.22.0")]
impl<T> RangeArgument<T> for RangeTo<T> {
fn start(&self) -> Bound<&T> {
Unbounded
Expand All @@ -94,6 +95,7 @@ impl<T> RangeArgument<T> for RangeTo<T> {
}
}

#[stable(feature = "collections_range", since = "1.22.0")]
impl<T> RangeArgument<T> for Range<T> {
fn start(&self) -> Bound<&T> {
Included(&self.start)
Expand Down
1 change: 0 additions & 1 deletion src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#![deny(warnings)]

#![feature(alloc)]
#![feature(collections_range)]
#![feature(macro_reexport)]
#![feature(staged_api)]

Expand Down
1 change: 0 additions & 1 deletion src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#![deny(warnings)]

#![feature(shared)]
#![feature(collections_range)]
#![feature(nonzero)]
#![feature(unboxed_closures)]
#![feature(fn_traits)]
Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@
#![feature(cfg_target_vendor)]
#![feature(char_error_internals)]
#![feature(char_internals)]
#![feature(collections_range)]
#![feature(compiler_builtins_lib)]
#![feature(const_fn)]
#![feature(core_float)]
Expand Down