Skip to content

Document panic in RangeInclusive::from(legacy::RangeInclusive)#155421

Open
tbu- wants to merge 1 commit intorust-lang:mainfrom
tbu-:pr_rangeinclusive_from_panic
Open

Document panic in RangeInclusive::from(legacy::RangeInclusive)#155421
tbu- wants to merge 1 commit intorust-lang:mainfrom
tbu-:pr_rangeinclusive_from_panic

Conversation

@tbu-
Copy link
Copy Markdown
Contributor

@tbu- tbu- commented Apr 17, 2026

No description provided.

@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 Apr 17, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

r? @jhpratt

rustbot has assigned @jhpratt.
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: @scottmcm, libs
  • @scottmcm, libs expanded to 7 candidates
  • Random selection from Mark-Simulacrum, jhpratt, scottmcm

@jhpratt
Copy link
Copy Markdown
Member

jhpratt commented Apr 17, 2026

Has this been approved by T-libs-api? The panic message clearly says unspecified, so adding this documentation would overrule that.

@tbu-
Copy link
Copy Markdown
Contributor Author

tbu- commented Apr 17, 2026

If T-libs doesn't want to guarantee this, I can change the wording to "currently panics, may not panic in the future". Or even "may panic".

@rust-log-analyzer

This comment has been minimized.

@tbu- tbu- force-pushed the pr_rangeinclusive_from_panic branch from 766773c to f43e3e7 Compare April 17, 2026 08:35
@fmease
Copy link
Copy Markdown
Member

fmease commented Apr 17, 2026

#155394

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- library/core/src/range.rs - range::RangeInclusive<T>::from (line 413) stdout ----
error[E0658]: use of unstable library feature `new_range_api_legacy`
   --> library/core/src/range.rs:418:13
    |
418 | let single: legacy::RangeInclusive<i32> = 0..=1;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #125687 <https://github.com/rust-lang/rust/issues/125687> for more information
    = help: add `#![feature(new_range_api_legacy)]` to the crate attributes to enable
    = note: this compiler was built on 2026-04-17; consider upgrading it if it is out of date

error[E0658]: use of unstable library feature `new_range_api_legacy`
   --> library/core/src/range.rs:422:12
    |
422 | let empty: legacy::RangeInclusive<i32> = 0..=0;
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #125687 <https://github.com/rust-lang/rust/issues/125687> for more information
    = help: add `#![feature(new_range_api_legacy)]` to the crate attributes to enable
    = note: this compiler was built on 2026-04-17; consider upgrading it if it is out of date

error[E0609]: no field `end` on type `std::range::RangeInclusive<i32>`
   --> library/core/src/range.rs:420:34
    |
420 | assert_eq!((single.start, single.end), (0, 1));
    |                                  ^^^ unknown field
    |
    = note: available fields are: `start`, `last`

error[E0609]: no field `end` on type `std::range::RangeInclusive<i32>`
   --> library/core/src/range.rs:424:32
    |
424 | assert_eq!((empty.start, empty.end), (0, 0));
    |                                ^^^ unknown field
    |
    = note: available fields are: `start`, `last`

error: aborting due to 4 previous errors
---
---- library/core/src/range.rs - range::RangeInclusive<T>::from (line 426) stdout ----
error[E0658]: use of unstable library feature `new_range_api_legacy`
   --> library/core/src/range.rs:431:20
    |
431 | let mut exhausted: legacy::RangeInclusive<i32> = 0..=0;
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #125687 <https://github.com/rust-lang/rust/issues/125687> for more information
    = help: add `#![feature(new_range_api_legacy)]` to the crate attributes to enable
    = note: this compiler was built on 2026-04-17; consider upgrading it if it is out of date

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.

5 participants