Skip to content

Commit fd18d25

Browse files
committed
Auto merge of #50758 - varkor:stabilise-inclusive_range_methods, r=SimonSapin
Stabilise inclusive_range_methods r? @SimonSapin Closes #49022.
2 parents 2a421f8 + ff0f00d commit fd18d25

File tree

7 files changed

+14
-20
lines changed

7 files changed

+14
-20
lines changed

src/liballoc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#![feature(try_reserve)]
2626
#![feature(unboxed_closures)]
2727
#![feature(exact_chunks)]
28-
#![feature(inclusive_range_methods)]
2928

3029
extern crate alloc_system;
3130
extern crate core;

src/libcore/ops/range.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,6 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
318318
/// # Examples
319319
///
320320
/// ```
321-
/// #![feature(inclusive_range_methods)]
322-
///
323321
/// assert_eq!((3..=5), std::ops::RangeInclusive::new(3, 5));
324322
/// assert_eq!(3 + 4 + 5, (3..=5).sum());
325323
///
@@ -345,12 +343,11 @@ impl<Idx> RangeInclusive<Idx> {
345343
/// # Examples
346344
///
347345
/// ```
348-
/// #![feature(inclusive_range_methods)]
349346
/// use std::ops::RangeInclusive;
350347
///
351348
/// assert_eq!(3..=5, RangeInclusive::new(3, 5));
352349
/// ```
353-
#[unstable(feature = "inclusive_range_methods", issue = "49022")]
350+
#[stable(feature = "inclusive_range_methods", since = "1.27.0")]
354351
#[inline]
355352
pub const fn new(start: Idx, end: Idx) -> Self {
356353
Self { start, end }
@@ -363,17 +360,18 @@ impl<Idx> RangeInclusive<Idx> {
363360
/// whether the inclusive range is empty, use the [`is_empty()`] method
364361
/// instead of comparing `start() > end()`.
365362
///
363+
/// Note: the value returned by this method is unspecified after the range
364+
/// has been iterated to exhaustion.
365+
///
366366
/// [`end()`]: #method.end
367367
/// [`is_empty()`]: #method.is_empty
368368
///
369369
/// # Examples
370370
///
371371
/// ```
372-
/// #![feature(inclusive_range_methods)]
373-
///
374372
/// assert_eq!((3..=5).start(), &3);
375373
/// ```
376-
#[unstable(feature = "inclusive_range_methods", issue = "49022")]
374+
#[stable(feature = "inclusive_range_methods", since = "1.27.0")]
377375
#[inline]
378376
pub fn start(&self) -> &Idx {
379377
&self.start
@@ -386,32 +384,34 @@ impl<Idx> RangeInclusive<Idx> {
386384
/// whether the inclusive range is empty, use the [`is_empty()`] method
387385
/// instead of comparing `start() > end()`.
388386
///
387+
/// Note: the value returned by this method is unspecified after the range
388+
/// has been iterated to exhaustion.
389+
///
389390
/// [`start()`]: #method.start
390391
/// [`is_empty()`]: #method.is_empty
391392
///
392393
/// # Examples
393394
///
394395
/// ```
395-
/// #![feature(inclusive_range_methods)]
396-
///
397396
/// assert_eq!((3..=5).end(), &5);
398397
/// ```
399-
#[unstable(feature = "inclusive_range_methods", issue = "49022")]
398+
#[stable(feature = "inclusive_range_methods", since = "1.27.0")]
400399
#[inline]
401400
pub fn end(&self) -> &Idx {
402401
&self.end
403402
}
404403

405-
/// Destructures the RangeInclusive into (lower bound, upper (inclusive) bound).
404+
/// Destructures the `RangeInclusive` into (lower bound, upper (inclusive) bound).
405+
///
406+
/// Note: the value returned by this method is unspecified after the range
407+
/// has been iterated to exhaustion.
406408
///
407409
/// # Examples
408410
///
409411
/// ```
410-
/// #![feature(inclusive_range_methods)]
411-
///
412412
/// assert_eq!((3..=5).into_inner(), (3, 5));
413413
/// ```
414-
#[unstable(feature = "inclusive_range_methods", issue = "49022")]
414+
#[stable(feature = "inclusive_range_methods", since = "1.27.0")]
415415
#[inline]
416416
pub fn into_inner(self) -> (Idx, Idx) {
417417
(self.start, self.end)

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#![feature(try_trait)]
4343
#![feature(exact_chunks)]
4444
#![feature(reverse_bits)]
45-
#![feature(inclusive_range_methods)]
4645
#![feature(iterator_find_map)]
4746
#![feature(slice_internals)]
4847

src/librustc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
#![feature(trusted_len)]
6969
#![feature(catch_expr)]
7070
#![feature(test)]
71-
#![feature(inclusive_range_methods)]
7271

7372
#![recursion_limit="512"]
7473

src/librustc_codegen_llvm/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#![feature(rustc_diagnostic_macros)]
3030
#![feature(slice_sort_by_cached_key)]
3131
#![feature(optin_builtin_traits)]
32-
#![feature(inclusive_range_methods)]
3332

3433
use rustc::dep_graph::WorkProduct;
3534
use syntax_pos::symbol::Symbol;

src/librustc_mir/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2929
#![feature(exhaustive_patterns)]
3030
#![feature(range_contains)]
3131
#![feature(rustc_diagnostic_macros)]
32-
#![feature(inclusive_range_methods)]
3332
#![feature(crate_visibility_modifier)]
3433
#![feature(never_type)]
3534
#![feature(specialization)]

src/librustc_target/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#![feature(const_fn)]
3030
#![feature(fs_read_write)]
3131
#![feature(inclusive_range)]
32-
#![feature(inclusive_range_methods)]
3332
#![feature(slice_patterns)]
3433

3534
#[macro_use]

0 commit comments

Comments
 (0)