Skip to content

Commit

Permalink
Rollup merge of rust-lang#125751 - pitaj:new_range_api, r=jhpratt
Browse files Browse the repository at this point in the history
Add `new_range_api` for RFC 3550

Initial implementation for rust-lang#125687

This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC. Having `From` is highly convenient and the debug assert should find almost all misuses.

This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum.

Currently the iterators are just wrappers around the old range types.

Tracking issues:

- rust-lang#123741
- rust-lang#125687
  • Loading branch information
workingjubilee authored Jul 6, 2024
2 parents ad4fde6 + d8965d3 commit 2337ab5
Show file tree
Hide file tree
Showing 6 changed files with 1,163 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ pub mod panicking;
#[unstable(feature = "core_pattern_types", issue = "none")]
pub mod pat;
pub mod pin;
#[unstable(feature = "new_range_api", issue = "125687")]
pub mod range;
pub mod result;
pub mod sync;

Expand Down
Loading

0 comments on commit 2337ab5

Please sign in to comment.