Skip to content

Commit 1aa43ba

Browse files
jhprattgitbot
authored and
gitbot
committed
Rollup merge of rust-lang#136167 - pitaj:new_range, r=Nadrieril
Implement unstable `new_range` feature Switches `a..b`, `a..`, and `a..=b` to resolve to the new range types. For rust-lang/rfcs#3550 Tracking issue rust-lang#123741 also adds the re-export that was missed in the original implementation of `new_range_api`
2 parents 514bab5 + a2f17b5 commit 1aa43ba

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

core/src/range.rs

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub use crate::ops::{Bound, OneSidedRange, RangeBounds, RangeFull, RangeTo, Rang
4848
/// assert_eq!(Range::from(3..5), Range { start: 3, end: 5 });
4949
/// assert_eq!(3 + 4 + 5, Range::from(3..6).into_iter().sum());
5050
/// ```
51+
#[cfg_attr(not(bootstrap), lang = "RangeCopy")]
5152
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)]
5253
#[unstable(feature = "new_range_api", issue = "125687")]
5354
pub struct Range<Idx> {
@@ -205,6 +206,7 @@ impl<T> From<legacy::Range<T>> for Range<T> {
205206
/// assert_eq!(RangeInclusive::from(3..=5), RangeInclusive { start: 3, end: 5 });
206207
/// assert_eq!(3 + 4 + 5, RangeInclusive::from(3..=5).into_iter().sum());
207208
/// ```
209+
#[cfg_attr(not(bootstrap), lang = "RangeInclusiveCopy")]
208210
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
209211
#[unstable(feature = "new_range_api", issue = "125687")]
210212
pub struct RangeInclusive<Idx> {
@@ -388,6 +390,7 @@ impl<T> From<legacy::RangeInclusive<T>> for RangeInclusive<T> {
388390
/// assert_eq!(RangeFrom::from(2..), core::range::RangeFrom { start: 2 });
389391
/// assert_eq!(2 + 3 + 4, RangeFrom::from(2..).into_iter().take(3).sum());
390392
/// ```
393+
#[cfg_attr(not(bootstrap), lang = "RangeFromCopy")]
391394
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
392395
#[unstable(feature = "new_range_api", issue = "125687")]
393396
pub struct RangeFrom<Idx> {

std/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ pub use core::option;
530530
pub use core::pin;
531531
#[stable(feature = "rust1", since = "1.0.0")]
532532
pub use core::ptr;
533+
#[unstable(feature = "new_range_api", issue = "125687")]
534+
pub use core::range;
533535
#[stable(feature = "rust1", since = "1.0.0")]
534536
pub use core::result;
535537
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)