Skip to content

Use bool instead of PartiolOrd as return value of the comparison closure in {slice,Iteraotr}::is_sorted_by#118811

Merged
bors merged 1 commit into
rust-lang:masterfrom
EbbDrop:is-sorted-by-bool
Jan 21, 2024
Merged

Use bool instead of PartiolOrd as return value of the comparison closure in {slice,Iteraotr}::is_sorted_by#118811
bors merged 1 commit into
rust-lang:masterfrom
EbbDrop:is-sorted-by-bool

Conversation

@EbbDrop

@EbbDrop EbbDrop commented Dec 10, 2023

Copy link
Copy Markdown
Contributor

Changes the function signature of the closure given to {slice,Iteraotr}::is_sorted_by to return a bool instead of a PartiolOrd as suggested by the libs-api team here: #53485 (comment).

This means these functions now return true if the closure returns true for all the pairs of values.

@rustbot

rustbot commented Dec 10, 2023

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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 Dec 10, 2023
@rust-log-analyzer

This comment has been minimized.

Comment thread library/core/src/iter/traits/iterator.rs
@KisaragiEffective

Copy link
Copy Markdown
Contributor

I have following concern:

  • It is breaking change
  • It is harder to remember which direction is expected to inequality predicate.

@the8472

the8472 commented Dec 14, 2023

Copy link
Copy Markdown
Member

Is sorted is an unstable feature, so breaking changes are allowed.

Comment thread compiler/rustc_monomorphize/src/partitioning.rs Outdated
@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 Dec 16, 2023
@WaffleLapkin

Copy link
Copy Markdown
Member

(this is marked as S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. , please use @rustbot review once this is ready for review) (learn more about rustbot commands)

@EbbDrop

EbbDrop commented Jan 12, 2024

Copy link
Copy Markdown
Contributor Author

@rustbot review

Ty for the pointer @WaffleLapkin

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

Copy link
Copy Markdown
Member

r=me with commits squashed. Thanks!

@EbbDrop

EbbDrop commented Jan 20, 2024

Copy link
Copy Markdown
Contributor Author

@bors r=Mark-Simulacrum

@bors

bors commented Jan 20, 2024

Copy link
Copy Markdown
Collaborator

@EbbDrop: 🔑 Insufficient privileges: Not in reviewers

@EbbDrop

EbbDrop commented Jan 20, 2024

Copy link
Copy Markdown
Contributor Author

@Mark-Simulacrum Looks like i am not allowed to use that bors command

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r=Mark-Simulacrum

@bors

bors commented Jan 20, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 606eeb8 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#116090 (Implement strict integer operations that panic on overflow)
 - rust-lang#118811 (Use `bool` instead of `PartiolOrd` as return value of the comparison closure in `{slice,Iteraotr}::is_sorted_by`)
 - rust-lang#119081 (Add Ipv6Addr::is_ipv4_mapped)
 - rust-lang#119461 (Use an interpreter in MIR jump threading)
 - rust-lang#119996 (Move OS String implementation into `sys`)
 - rust-lang#120015 (coverage: Format all coverage tests with `rustfmt`)
 - rust-lang#120027 (pattern_analysis: Remove `Ty: Copy` bound)
 - rust-lang#120084 (fix(rust-analyzer): use new pkgid spec to compare)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e8d1c2e into rust-lang:master Jan 21, 2024
@rustbot rustbot added this to the 1.77.0 milestone Jan 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
Rollup merge of rust-lang#118811 - EbbDrop:is-sorted-by-bool, r=Mark-Simulacrum

Use `bool` instead of `PartiolOrd` as return value of the comparison closure in `{slice,Iteraotr}::is_sorted_by`

Changes the function signature of the closure given to `{slice,Iteraotr}::is_sorted_by` to return a `bool` instead of a `PartiolOrd` as suggested by the libs-api team here: rust-lang#53485 (comment).

This means these functions now return true if the closure returns true for all the pairs of values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

8 participants