-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Constify cmp_min_max_by. #102245
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Constify cmp_min_max_by. #102245
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
r? @scottmcm (rust-highfive has picked a reviewer for you, use r? to override) |
r? @fee1-dead |
@rustbot label +T-libs-api -T-libs |
@bors r+ |
…fee1-dead Rollup of 8 pull requests Successful merges: - rust-lang#98111 (Clarify `[T]::select_nth_unstable*` return values) - rust-lang#101431 (Look at move place's type when suggesting mutable reborrow) - rust-lang#101800 (Constify slice.split_at_mut(_unchecked)) - rust-lang#101997 (Remove support for legacy PM) - rust-lang#102194 (Note the type when unable to drop values in compile time) - rust-lang#102200 (Constify Default impl's for Arrays and Tuples.) - rust-lang#102245 (Constify cmp_min_max_by.) - rust-lang#102259 (Type-annotate and simplify documentation of Option::unwrap_or_default) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
pub const fn min_by<T, F: ~const FnOnce(&T, &T) -> Ordering>(v1: T, v2: T, compare: F) -> T | ||
where | ||
T: ~const Destruct, | ||
F: ~const Destruct, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think F needs to be dropped here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh right thats an FnOnce, will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fixing this in the const iterator PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks!
@rustbot label +const-hack |
Revert 102245 reverts rust-lang#102245, but only on beta, as that caused rust-lang#109543 which has since been fixed on nightly. This needed an additional partial revert of rust-lang@5b08c9f for changes that happened due to later cleanups. I also added a test from the issue to make sure this actually fixes it 😆 r? `@wesleywiser` `@pnkfelix`
Constifies
core::cmp::{min, max}_by[_key]
behind theconst_cmp
#92391 feature gate, usingconst_closure
.