1
Fork 0

Auto merge of #50758 - varkor:stabilise-inclusive_range_methods, r=SimonSapin

Stabilise inclusive_range_methods

r? @SimonSapin

Closes #49022.
This commit is contained in:
bors 2018-05-18 08:10:23 +00:00
commit fd18d2537d
7 changed files with 14 additions and 20 deletions

View file

@ -25,7 +25,6 @@
#![feature(try_reserve)] #![feature(try_reserve)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(exact_chunks)] #![feature(exact_chunks)]
#![feature(inclusive_range_methods)]
extern crate alloc_system; extern crate alloc_system;
extern crate core; extern crate core;

View file

@ -318,8 +318,6 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(inclusive_range_methods)]
///
/// assert_eq!((3..=5), std::ops::RangeInclusive::new(3, 5)); /// assert_eq!((3..=5), std::ops::RangeInclusive::new(3, 5));
/// assert_eq!(3 + 4 + 5, (3..=5).sum()); /// assert_eq!(3 + 4 + 5, (3..=5).sum());
/// ///
@ -345,12 +343,11 @@ impl<Idx> RangeInclusive<Idx> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(inclusive_range_methods)]
/// use std::ops::RangeInclusive; /// use std::ops::RangeInclusive;
/// ///
/// assert_eq!(3..=5, RangeInclusive::new(3, 5)); /// assert_eq!(3..=5, RangeInclusive::new(3, 5));
/// ``` /// ```
#[unstable(feature = "inclusive_range_methods", issue = "49022")] #[stable(feature = "inclusive_range_methods", since = "1.27.0")]
#[inline] #[inline]
pub const fn new(start: Idx, end: Idx) -> Self { pub const fn new(start: Idx, end: Idx) -> Self {
Self { start, end } Self { start, end }
@ -363,17 +360,18 @@ impl<Idx> RangeInclusive<Idx> {
/// whether the inclusive range is empty, use the [`is_empty()`] method /// whether the inclusive range is empty, use the [`is_empty()`] method
/// instead of comparing `start() > end()`. /// instead of comparing `start() > end()`.
/// ///
/// Note: the value returned by this method is unspecified after the range
/// has been iterated to exhaustion.
///
/// [`end()`]: #method.end /// [`end()`]: #method.end
/// [`is_empty()`]: #method.is_empty /// [`is_empty()`]: #method.is_empty
/// ///
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(inclusive_range_methods)]
///
/// assert_eq!((3..=5).start(), &3); /// assert_eq!((3..=5).start(), &3);
/// ``` /// ```
#[unstable(feature = "inclusive_range_methods", issue = "49022")] #[stable(feature = "inclusive_range_methods", since = "1.27.0")]
#[inline] #[inline]
pub fn start(&self) -> &Idx { pub fn start(&self) -> &Idx {
&self.start &self.start
@ -386,32 +384,34 @@ impl<Idx> RangeInclusive<Idx> {
/// whether the inclusive range is empty, use the [`is_empty()`] method /// whether the inclusive range is empty, use the [`is_empty()`] method
/// instead of comparing `start() > end()`. /// instead of comparing `start() > end()`.
/// ///
/// Note: the value returned by this method is unspecified after the range
/// has been iterated to exhaustion.
///
/// [`start()`]: #method.start /// [`start()`]: #method.start
/// [`is_empty()`]: #method.is_empty /// [`is_empty()`]: #method.is_empty
/// ///
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(inclusive_range_methods)]
///
/// assert_eq!((3..=5).end(), &5); /// assert_eq!((3..=5).end(), &5);
/// ``` /// ```
#[unstable(feature = "inclusive_range_methods", issue = "49022")] #[stable(feature = "inclusive_range_methods", since = "1.27.0")]
#[inline] #[inline]
pub fn end(&self) -> &Idx { pub fn end(&self) -> &Idx {
&self.end &self.end
} }
/// Destructures the RangeInclusive into (lower bound, upper (inclusive) bound). /// Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound).
///
/// Note: the value returned by this method is unspecified after the range
/// has been iterated to exhaustion.
/// ///
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(inclusive_range_methods)]
///
/// assert_eq!((3..=5).into_inner(), (3, 5)); /// assert_eq!((3..=5).into_inner(), (3, 5));
/// ``` /// ```
#[unstable(feature = "inclusive_range_methods", issue = "49022")] #[stable(feature = "inclusive_range_methods", since = "1.27.0")]
#[inline] #[inline]
pub fn into_inner(self) -> (Idx, Idx) { pub fn into_inner(self) -> (Idx, Idx) {
(self.start, self.end) (self.start, self.end)

View file

@ -42,7 +42,6 @@
#![feature(try_trait)] #![feature(try_trait)]
#![feature(exact_chunks)] #![feature(exact_chunks)]
#![feature(reverse_bits)] #![feature(reverse_bits)]
#![feature(inclusive_range_methods)]
#![feature(iterator_find_map)] #![feature(iterator_find_map)]
#![feature(slice_internals)] #![feature(slice_internals)]

View file

@ -68,7 +68,6 @@
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(catch_expr)] #![feature(catch_expr)]
#![feature(test)] #![feature(test)]
#![feature(inclusive_range_methods)]
#![recursion_limit="512"] #![recursion_limit="512"]

View file

@ -29,7 +29,6 @@
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(slice_sort_by_cached_key)] #![feature(slice_sort_by_cached_key)]
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
#![feature(inclusive_range_methods)]
use rustc::dep_graph::WorkProduct; use rustc::dep_graph::WorkProduct;
use syntax_pos::symbol::Symbol; use syntax_pos::symbol::Symbol;

View file

@ -29,7 +29,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(exhaustive_patterns)] #![feature(exhaustive_patterns)]
#![feature(range_contains)] #![feature(range_contains)]
#![feature(rustc_diagnostic_macros)] #![feature(rustc_diagnostic_macros)]
#![feature(inclusive_range_methods)]
#![feature(crate_visibility_modifier)] #![feature(crate_visibility_modifier)]
#![feature(never_type)] #![feature(never_type)]
#![feature(specialization)] #![feature(specialization)]

View file

@ -29,7 +29,6 @@
#![feature(const_fn)] #![feature(const_fn)]
#![feature(fs_read_write)] #![feature(fs_read_write)]
#![feature(inclusive_range)] #![feature(inclusive_range)]
#![feature(inclusive_range_methods)]
#![feature(slice_patterns)] #![feature(slice_patterns)]
#[macro_use] #[macro_use]