Skip to content

Weaken guarantee for From<legacy::RangeInclusive> for RangeInclusive#158770

Open
theemathas wants to merge 1 commit into
rust-lang:mainfrom
theemathas:range-inclusive-from
Open

Weaken guarantee for From<legacy::RangeInclusive> for RangeInclusive#158770
theemathas wants to merge 1 commit into
rust-lang:mainfrom
theemathas:range-inclusive-from

Conversation

@theemathas

@theemathas theemathas commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

As per #155114 (comment), this From impl no longer guarantees panicking for exhausted iterators. Instead, it only guarantees that the conversion will either panic or produce an empty range.

This is done so that we can optimize the implementation of legacy::RangeInclusive in a way such that we cannot check if it has been exhausted in a generic context without a Step and/or PartialOrd bound.

If this PR and/or #155114 merges after the 1.98.0 beta branch promotion from the main branch, then this will need a beta backport, since this PR changes the stable guarantee previously made in #155421.

This PR conflicts with and/or blocks #155114.

As per rust-lang#155114 (comment),
this `From` impl no longer guarantees panicking for exhausted iterators.
Instead, it only guarantees that the conversion will either panic or
produce an empty range.

This is done so that we can optimize the implementation of
`legacy::RangeInclusive` in a way such that we cannot check if it has
been exhausted in a generic context without a `Step` and/or `PartialOrd`
bound.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 4, 2026
@rustbot

rustbot commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
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: libs
  • libs expanded to 12 candidates
  • Random selection from 6 candidates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants