Weaken guarantee for From<legacy::RangeInclusive> for RangeInclusive#158770
Conversation
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.
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
(not beta-nominated but if the promotion happens meanwhile, please add the label) |
…=JohnTitor Weaken guarantee for `From<legacy::RangeInclusive> for RangeInclusive` 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. If this PR and/or rust-lang#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 rust-lang#155421. This PR conflicts with and/or blocks rust-lang#155114.
|
@bors try jobs=test-various |
This comment has been minimized.
This comment has been minimized.
Weaken guarantee for `From<legacy::RangeInclusive> for RangeInclusive` try-job: test-various
|
💔 Test for e35034e failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
Does |
|
@bors r- |
|
This pull request was unapproved. This PR was contained in a rollup (#158806), which was unapproved. |
|
The test failed because |
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Weaken guarantee for `From<legacy::RangeInclusive> for RangeInclusive`
|
This didn't make it in time for 1.98.0, since #158740 has been merged. So, this will need a backport to 1.98.0. |
|
@bors r+ |
…=JohnTitor Weaken guarantee for `From<legacy::RangeInclusive> for RangeInclusive` 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. If this PR and/or rust-lang#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 rust-lang#155421. This PR conflicts with and/or blocks rust-lang#155114.
…uwer Rollup of 12 pull requests Successful merges: - #156976 (enable eager `param_env` norm in new solver) - #158537 (Add `std::io::cursor::WriteThroughCursor`) - #158540 (Move `std::io::Seek` to `core::io`) - #157820 (consider subtyping when checking if an infer var is sized) - #158505 (Update POSIX edition links) - #158853 (Fix typo for link on nto-qnx.md) - #157466 (Better error message when bare type in impl parameter list) - #157966 (Emit a suggestion to cast the never type into a concrete type when it fails to satisfy an `impl Trait` bound) - #158381 (Expose debug scope of statement and terminator in rustc_public) - #158405 (rustc_target: Add ARMv8-M related target features) - #158770 (Weaken guarantee for `From<legacy::RangeInclusive> for RangeInclusive`) - #158820 (Fix rustdoc ICE on deprecated note in inlined re-export chain)
Rollup merge of #158770 - theemathas:range-inclusive-from, r=JohnTitor Weaken guarantee for `From<legacy::RangeInclusive> for RangeInclusive` 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 #155114 (comment), this
Fromimpl 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::RangeInclusivein a way such that we cannot check if it has been exhausted in a generic context without aStepand/orPartialOrdbound.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.