Skip to content

Stabilize core::range::{legacy, RangeFull, RangeTo}#156629

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
tgross35:range-module-stabilizations
Jun 11, 2026
Merged

Stabilize core::range::{legacy, RangeFull, RangeTo}#156629
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
tgross35:range-module-stabilizations

Conversation

@tgross35

Copy link
Copy Markdown
Contributor

Stabilize core::range::legacy and the re-exports of unchanged range types, so all range types can now be imported from within core::range. Newly stable API:

use core::range::RangeFull;
use core::range::RangeTo;
use core::range::legacy::{Range, RangeFrom, RangeInclusive, RangeToInclusive};

Compared to what is in the comment, I made a few exclusions:

  1. At Tracking Issue for new_range_api (part of RFC 3550) #125687 (comment), @sendittothenewts suggested not to stabilize core::range::RangeBounds in case we want to reuse that name for a replacement based on IntoBounds. I have excluded it here so we can discuss further. range_into_bounds tracking issue: Tracking Issue for range_into_bounds #136903
  2. one_sided_range types should probably just move into this module rather than being exported, since they are unstable. Added an unresolved question at Tracking Issue for OneSidedRange #69780.
  3. Similarly, step_trait is unstable so we could just move crate::iter::Step if core::range is a better home. Added an unresolved question at Tracking issue for step_trait stabilization #42168.

Since this is the last thing in new_range_api that isn't tracked elsewhere:

Closes: #125687

Cc @pitaj

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 15, 2026
@rustbot

rustbot commented May 15, 2026

Copy link
Copy Markdown
Collaborator

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 17 candidates

@tgross35

Copy link
Copy Markdown
Contributor Author

r? libs

This API isn't covered by the FCP on the tracking issue:

@rustbot label +I-libs-api-nominated

@rustbot rustbot added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label May 15, 2026
@tgross35 tgross35 added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label May 15, 2026
@rust-log-analyzer

This comment has been minimized.

@tgross35 tgross35 force-pushed the range-module-stabilizations branch from 66c5493 to 8d9f3da Compare May 15, 2026 23:36
@rust-log-analyzer

This comment has been minimized.

@Amanieu

Amanieu commented May 26, 2026

Copy link
Copy Markdown
Member

@rfcbot merge libs-api

@rust-rfcbot

rust-rfcbot commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 26, 2026
@Amanieu Amanieu removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. I-libs-api-nominated Nominated for discussion during a libs-api team meeting. labels May 26, 2026
@rust-rfcbot rust-rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label May 27, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jun 6, 2026
@rust-rfcbot

Copy link
Copy Markdown
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

@rust-rfcbot rust-rfcbot added the to-announce Announce this issue on triage meeting label Jun 6, 2026
@Mark-Simulacrum

Copy link
Copy Markdown
Member

r=me with CI fixed

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 7, 2026
@rustbot

rustbot commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@tgross35 tgross35 force-pushed the range-module-stabilizations branch from 8d9f3da to b909841 Compare June 11, 2026 02:03
@rustbot

rustbot commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

tgross35 added 2 commits June 10, 2026 21:07
Newly stable API:

    core::range::legacy
Stabilized under `new_range_api_exports`. Newly stable API:

    core::range::RangeFull;
    core::range::RangeTo;
@tgross35 tgross35 force-pushed the range-module-stabilizations branch from b909841 to 1c8c2e5 Compare June 11, 2026 02:07
@tgross35

Copy link
Copy Markdown
Contributor Author

Rebased and blessed the needed test.

@bors r=Mark-Simulacrum

@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 1c8c2e5 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 11, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 11, 2026
…ns, r=Mark-Simulacrum

Stabilize `core::range::{legacy, RangeFull, RangeTo}`

Stabilize `core::range::legacy` and the re-exports of unchanged range types, so all range types can now be imported from within `core::range`. Newly stable API:

```rust
use core::range::RangeFull;
use core::range::RangeTo;
use core::range::legacy::{Range, RangeFrom, RangeInclusive, RangeToInclusive};
```

Compared to what is in the comment, I made a few exclusions:

1. At rust-lang#125687 (comment), @sendittothenewts suggested not to stabilize `core::range::RangeBounds` in case we want to reuse that name for a replacement based on `IntoBounds`. I have excluded it here so we can discuss further. `range_into_bounds` tracking issue: rust-lang#136903
2.   `one_sided_range` types should probably just move into this module rather than being exported, since they are unstable. Added an unresolved question at rust-lang#69780.
3. Similarly, `step_trait ` is unstable so we could just move `crate::iter::Step` if `core::range` is a better home. Added an unresolved question at rust-lang#42168.

Since this is the last thing in `new_range_api` that isn't tracked elsewhere:

Closes: rust-lang#125687
rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
Rollup of 31 pull requests

Successful merges:

 - #141030 (Expand free alias types during variance computation)
 - #154853 (mgca: Register `ConstArgHasType` when normalizing projection consts)
 - #155527 (Replace printables table with `unicode_data.rs` tables)
 - #156629 (Stabilize `core::range::{legacy, RangeFull, RangeTo}`)
 - #157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty)
 - #157282 (Fix post-monomorphization error note race in the parallel frontend)
 - #157352 (Make the retained dep graph deterministic under the parallel frontend)
 - #157601 (Emit error for unused target expression in glob and list delegations)
 - #157611 (Update `browser-ui-test` version to `0.24.0`)
 - #157620 (Add a strategy FnMut to inject behavior into the flush cycle)
 - #157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded)
 - #157646 (Keep rename-imported main alive in dead-code analysis under `--test`)
 - #157647 (Start using comptime for reflection intrinsics and their wrapper functions)
 - #157719 (resolve: Partially revert "Remove a special case for dummy imports")
 - #155153 (Ensure Send/Sync is not implemented for std::env::Vars{,Os})
 - #155198 (fix(mgca): Allow specifying generic args (of enum) on enum itself in unit & tuple variant constructions in (direct) const args)
 - #155323 (refactor `TypeRelativePath::AssocItem` to use `AliasTerm`)
 - #156497 (fix-155516: Don't suggest wrong unwrap expect)
 - #156583 (Support defaults for static EIIs)
 - #157013 (Ensure inferred let pattern types are well-formed)
 - #157196 (Only suggest reborrowing a moved value where the reborrow is valid)
 - #157230 (borrowck: avoid ICE describing fields on generic params)
 - #157288 (platform support: add SNaN erratum to MIPS targets)
 - #157330 (remove `IsTypeConst` from `hir::TraitItemKind`)
 - #157350 (compiletest: ignore SVG `y` offset in by-lines comparison)
 - #157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs)
 - #157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`)
 - #157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N))
 - #157691 (Move symbol hiding code to a new file)
 - #157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N))
 - #157703 (Fix doc link to Instant sub in saturating caveat)

Failed merges:

 - #157699 (Arg splat experiment - hir FnDecl impl)
@rust-bors rust-bors Bot merged commit 00c9f84 into rust-lang:main Jun 11, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 11, 2026
rust-timer added a commit that referenced this pull request Jun 11, 2026
Rollup merge of #156629 - tgross35:range-module-stabilizations, r=Mark-Simulacrum

Stabilize `core::range::{legacy, RangeFull, RangeTo}`

Stabilize `core::range::legacy` and the re-exports of unchanged range types, so all range types can now be imported from within `core::range`. Newly stable API:

```rust
use core::range::RangeFull;
use core::range::RangeTo;
use core::range::legacy::{Range, RangeFrom, RangeInclusive, RangeToInclusive};
```

Compared to what is in the comment, I made a few exclusions:

1. At #125687 (comment), @sendittothenewts suggested not to stabilize `core::range::RangeBounds` in case we want to reuse that name for a replacement based on `IntoBounds`. I have excluded it here so we can discuss further. `range_into_bounds` tracking issue: #136903
2.   `one_sided_range` types should probably just move into this module rather than being exported, since they are unstable. Added an unresolved question at #69780.
3. Similarly, `step_trait ` is unstable so we could just move `crate::iter::Step` if `core::range` is a better home. Added an unresolved question at #42168.

Since this is the last thing in `new_range_api` that isn't tracked elsewhere:

Closes: #125687
LaneAsade pushed a commit to LaneAsade/rust that referenced this pull request Jun 11, 2026
Rollup of 31 pull requests

Successful merges:

 - rust-lang#141030 (Expand free alias types during variance computation)
 - rust-lang#154853 (mgca: Register `ConstArgHasType` when normalizing projection consts)
 - rust-lang#155527 (Replace printables table with `unicode_data.rs` tables)
 - rust-lang#156629 (Stabilize `core::range::{legacy, RangeFull, RangeTo}`)
 - rust-lang#157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty)
 - rust-lang#157282 (Fix post-monomorphization error note race in the parallel frontend)
 - rust-lang#157352 (Make the retained dep graph deterministic under the parallel frontend)
 - rust-lang#157601 (Emit error for unused target expression in glob and list delegations)
 - rust-lang#157611 (Update `browser-ui-test` version to `0.24.0`)
 - rust-lang#157620 (Add a strategy FnMut to inject behavior into the flush cycle)
 - rust-lang#157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded)
 - rust-lang#157646 (Keep rename-imported main alive in dead-code analysis under `--test`)
 - rust-lang#157647 (Start using comptime for reflection intrinsics and their wrapper functions)
 - rust-lang#157719 (resolve: Partially revert "Remove a special case for dummy imports")
 - rust-lang#155153 (Ensure Send/Sync is not implemented for std::env::Vars{,Os})
 - rust-lang#155198 (fix(mgca): Allow specifying generic args (of enum) on enum itself in unit & tuple variant constructions in (direct) const args)
 - rust-lang#155323 (refactor `TypeRelativePath::AssocItem` to use `AliasTerm`)
 - rust-lang#156497 (fix-155516: Don't suggest wrong unwrap expect)
 - rust-lang#156583 (Support defaults for static EIIs)
 - rust-lang#157013 (Ensure inferred let pattern types are well-formed)
 - rust-lang#157196 (Only suggest reborrowing a moved value where the reborrow is valid)
 - rust-lang#157230 (borrowck: avoid ICE describing fields on generic params)
 - rust-lang#157288 (platform support: add SNaN erratum to MIPS targets)
 - rust-lang#157330 (remove `IsTypeConst` from `hir::TraitItemKind`)
 - rust-lang#157350 (compiletest: ignore SVG `y` offset in by-lines comparison)
 - rust-lang#157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs)
 - rust-lang#157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`)
 - rust-lang#157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N))
 - rust-lang#157691 (Move symbol hiding code to a new file)
 - rust-lang#157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N))
 - rust-lang#157703 (Fix doc link to Instant sub in saturating caveat)

Failed merges:

 - rust-lang#157699 (Arg splat experiment - hir FnDecl impl)
LaneAsade pushed a commit to LaneAsade/rust that referenced this pull request Jun 11, 2026
Rollup of 31 pull requests

Successful merges:

 - rust-lang#141030 (Expand free alias types during variance computation)
 - rust-lang#154853 (mgca: Register `ConstArgHasType` when normalizing projection consts)
 - rust-lang#155527 (Replace printables table with `unicode_data.rs` tables)
 - rust-lang#156629 (Stabilize `core::range::{legacy, RangeFull, RangeTo}`)
 - rust-lang#157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty)
 - rust-lang#157282 (Fix post-monomorphization error note race in the parallel frontend)
 - rust-lang#157352 (Make the retained dep graph deterministic under the parallel frontend)
 - rust-lang#157601 (Emit error for unused target expression in glob and list delegations)
 - rust-lang#157611 (Update `browser-ui-test` version to `0.24.0`)
 - rust-lang#157620 (Add a strategy FnMut to inject behavior into the flush cycle)
 - rust-lang#157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded)
 - rust-lang#157646 (Keep rename-imported main alive in dead-code analysis under `--test`)
 - rust-lang#157647 (Start using comptime for reflection intrinsics and their wrapper functions)
 - rust-lang#157719 (resolve: Partially revert "Remove a special case for dummy imports")
 - rust-lang#155153 (Ensure Send/Sync is not implemented for std::env::Vars{,Os})
 - rust-lang#155198 (fix(mgca): Allow specifying generic args (of enum) on enum itself in unit & tuple variant constructions in (direct) const args)
 - rust-lang#155323 (refactor `TypeRelativePath::AssocItem` to use `AliasTerm`)
 - rust-lang#156497 (fix-155516: Don't suggest wrong unwrap expect)
 - rust-lang#156583 (Support defaults for static EIIs)
 - rust-lang#157013 (Ensure inferred let pattern types are well-formed)
 - rust-lang#157196 (Only suggest reborrowing a moved value where the reborrow is valid)
 - rust-lang#157230 (borrowck: avoid ICE describing fields on generic params)
 - rust-lang#157288 (platform support: add SNaN erratum to MIPS targets)
 - rust-lang#157330 (remove `IsTypeConst` from `hir::TraitItemKind`)
 - rust-lang#157350 (compiletest: ignore SVG `y` offset in by-lines comparison)
 - rust-lang#157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs)
 - rust-lang#157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`)
 - rust-lang#157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N))
 - rust-lang#157691 (Move symbol hiding code to a new file)
 - rust-lang#157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N))
 - rust-lang#157703 (Fix doc link to Instant sub in saturating caveat)

Failed merges:

 - rust-lang#157699 (Arg splat experiment - hir FnDecl impl)
@tgross35 tgross35 deleted the range-module-stabilizations branch June 11, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

finished-final-comment-period The final comment period is finished for this PR / Issue. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for new_range_api (part of RFC 3550)

7 participants