Repository navigation
Iterator::{min,max}(_by_key) should use overridden min/max/lt - #160203
Conversation
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
`Iterator::{min,max}(_by_key)` should use overridden `min`/`max`/`lt`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e9abde2): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.1%, secondary 0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.1%, secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 490.333s -> 489.5s (-0.17%) |
|
This doing nothing for primary icount doesn't really surprise me. I doubt it's used that much in the compiler, especially not with tricky types. (For primitives since the "No action needed" is great. |
There was a problem hiding this comment.
Ok, makes sense! Marking as iffy as this could cause some potential perf issues and we might want to bisect in the future
@bors r+ rollup=iffy
…uwer Rollup of 5 pull requests Successful merges: - #160203 (`Iterator::{min,max}(_by_key)` should use overridden `min`/`max`/`lt`) - #159862 (Update expect messages for library/alloc/src/vec/mod.rs) - #160719 (Improve OpenOptions append+truncate error message) - #160996 (Forward all array `PartialOrd` to slices) - #161102 (Explicitly pass run_make_support rlib/rmeta paths to compiletest)
Rollup merge of #160203 - scottmcm:cmp-with-key, r=JohnTitor `Iterator::{min,max}(_by_key)` should use overridden `min`/`max`/`lt` Two related changes to provided Iterator implementations: - `Iterator::min` and `Iterator::max` are currently implemented via `min_by` and `max_by`, which means they don't use `Ord::{min,max}` despite those being overridable to do something more efficient. Move these to just being `.reduce(Ord::min)` and `.reduce(Ord::max)` to take advantage of potential overrides. - `Iterator::min_by_key` and `Iterator::max_by_key` are implemented by mapping to a tuple then using `min_by`/`max_by` with a comparator that only looks at one field in the tuple. That means they end up doing things like `a.cmp(b).is_le()`, which is wasteful if there an overloaded `-> bool` method it could use instead. So rephrase these two to work as `.map(…).min()`/`.map(…).max()` by mapping to a type that's *not* a tuple and which can thus override more things instead of just passing a `Fn(…) -> Ordering`.
Rollup merge of #160203 - scottmcm:cmp-with-key, r=JohnTitor `Iterator::{min,max}(_by_key)` should use overridden `min`/`max`/`lt` Two related changes to provided Iterator implementations: - `Iterator::min` and `Iterator::max` are currently implemented via `min_by` and `max_by`, which means they don't use `Ord::{min,max}` despite those being overridable to do something more efficient. Move these to just being `.reduce(Ord::min)` and `.reduce(Ord::max)` to take advantage of potential overrides. - `Iterator::min_by_key` and `Iterator::max_by_key` are implemented by mapping to a tuple then using `min_by`/`max_by` with a comparator that only looks at one field in the tuple. That means they end up doing things like `a.cmp(b).is_le()`, which is wasteful if there an overloaded `-> bool` method it could use instead. So rephrase these two to work as `.map(…).min()`/`.map(…).max()` by mapping to a type that's *not* a tuple and which can thus override more things instead of just passing a `Fn(…) -> Ordering`.
|
This will hopefully make #161081 more effective too, using those overridden |
Pkgsrc changes: * Version & checksum changes. * Adapt patches to match. Upstream changes: Version 1.100.0 (2026-11-12) ========================== Language -------- - [Stabilize never type] (rust-lang/rust#155499) - [Lint against repeated `#[repr(..)]` attributes] (rust-lang/rust#157036) - [Stabilize `extern "custom"`] (rust-lang/rust#158504) - [Extend `dropping_references`, `dropping_copy_types` and `undropped_manually_drops` lints to `drop_in_place`] (rust-lang/rust#160229) - [`unfulfilled_lint_expectations` no longer fires on `#[expect(dead_code)]` inside code that is covered by a dead parent's diagnostic] (rust-lang/rust#161005) - [Turn the error for `repr(align)` fields in a `repr(packed)` type into a deny-by-default lint `aligned_fields_in_packed`] (rust-lang/rust#162160) - [volatile: allow accesses to non-AM memory to trap] (rust-lang/rust#160564) Compiler -------- - [Stabilize `-Cprofile-sample-use`] (rust-lang/rust#155942) - [Enable next solver by default in orphanck] (rust-lang/rust#160668) Platform Support ---------------- - [`i686-pc-windows-gnu` is now a tier 2 without host tools target] (rust-lang/rust#161681) - [Promote `wasm32-wasip3` to Tier 2] (rust-lang/rust#161940) - [Add new Tier 3 target `powerpc64-sony-ps3`] (rust-lang/rust#162072) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. [platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html Libraries --------- - [Stabilize custom allocators] (rust-lang/rust#156882) - [Map `ENOTSUP` to `ErrorKind::Unsupported`] (rust-lang/rust#158580) - [Fix soundness issues in `std::sys::pal::sgx::waitqueue::unsafe_list`] (rust-lang/rust#161334) Stabilized APIs --------------- - [`impl PartialEq<Cow<'_, [U]>> for Vec<T, A>`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#impl-PartialEq%3CCow%3C'_,+%5BU%5D%3E%3E-for-Vec%3CT,+A%3E) - [`impl PartialEq<Cow<'_, [U]>> for &[T]`] (https://doc.rust-lang.org/stable/std/primitive.slice.html#impl-PartialEq%3CCow%3C'_,+%5BU%5D%3E%3E-for-%26%5BT%5D) - [`impl PartialEq<Cow<'_, [U]>> for &mut [T]`] (https://doc.rust-lang.org/stable/std/primitive.slice.html#impl-PartialEq%3CCow%3C'_,+%5BU%5D%3E%3E-for-%26mut+%5BT%5D) - [`std::alloc::Allocator`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html) - [`std::alloc::Global`] (https://doc.rust-lang.org/stable/std/alloc/struct.Global.html) - [`std::alloc::System`] (https://doc.rust-lang.org/stable/std/alloc/struct.System.html) - [`impl Allocator for Global`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Global) - [`impl Allocator for System`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-System) - [`impl<A: Allocator> Allocator for &A`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-%26A) - [`impl<T: Allocator, A: Allocator> Allocator for Box<T, A>`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Box%3CT,+A%3E) - [`impl<A: Allocator> Allocator for &mut A`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-%26mut+A) - [`impl<T: Allocator, A: Allocator> Allocator for Arc<T, A>`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Arc%3CT,+A%3E) - [`impl<T: Allocator, A: Allocator> Allocator for Rc<T, A>`] (https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Rc%3CT,+A%3E) - [`Box::new_in`] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.new_in) - [`Box::from_raw_in`] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.from_raw_in) - [`Box::from_non_null_in`] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.from_non_null_in) - [`Box::into_raw_with_allocator`] (https://doc.rust-lang.org/std/std/boxed/struct.Box.html#method.into_raw_with_allocator) - [`Box::into_non_null_with_allocator`] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.into_non_null_with_allocator) - [`Box::allocator`] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.allocator) - [`Vec::new_in`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.new_in) - [`Vec::with_capacity_in`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.with_capacity_in) - [`Vec::from_raw_parts_in`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.from_raw_parts_in) - [`Vec::from_parts_in`] (https://doc.rust-lang.org/stable/stable/vec/struct.Vec.html#method.from_parts_in) - [`Vec::into_raw_parts_with_allocator`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.into_raw_parts_with_allocator) - [`Vec::into_parts_with_allocator`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.into_parts_with_allocator) - [`Vec::allocator`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.allocator) - [`Child::main_thread_handle`] (https://doc.rust-lang.org/stable/std/os/windows/process/trait.ChildExt.html#tymethod.main_thread_handle) - [`impl Default for std::sync::Once`] (https://doc.rust-lang.org/stable/std/sync/struct.Once.html#impl-Default-for-Once) - [`bool::toggle`] (https://doc.rust-lang.org/stable/std/primitive.bool.html#method.toggle) - [`Box::take`] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.take) - [`Box::map`] (https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.map) - [`Rc::map`] (https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.map) - [`Arc::map`] (https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.map) - [`impl AsRef<T> for !`] (https://doc.rust-lang.org/stable/std/primitive.never.html#impl-AsRef<T>-for-!) - [`impl AsMut<T> for !`] (https://doc.rust-lang.org/stable/std/primitive.never.html#impl-AsMut<T>-for-!) - [`core::mem::DropGuard`] (https://doc.rust-lang.org/stable/core/mem/struct.DropGuard.html) - [`core::mem::conjure_zst`] (https://doc.rust-lang.org/stable/core/mem/fn.conjure_zst.html) - [`UnsafeCell::replace`] (https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.replace) - [`UnsafeCell::as_ref_unchecked`] (https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.as_ref_unchecked) - [`UnsafeCell::as_mut_unchecked`] (https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.as_mut_unchecked) - [`str::trim_prefix`] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.trim_prefix) - [`str::trim_suffix`] (https://doc.rust-lang.org/stable/std/primitive.str.html#method.trim_suffix) - [`[T]::trim_prefix`] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.trim_prefix) - [`[T]::trim_suffix`] (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.trim_suffix) - [`Path::trim_prefix`] (https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.trim_prefix) - [`Vec::from_fn`] (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.from_fn) - [`os::windows::process::CommandExt::show_window`] (https://doc.rust-lang.org/stable/std/os/windows/process/trait.CommandExt.html#tymethod.show_window) Cargo ----- - Introduced Cargo's own linting system: some Cargo warnings are now emitted as lints that users can control in the `[lints.cargo]` table. This includes a new built-in unused dependency check via the `cargo::unused_dependencies` lint. [docs](https://doc.rust-lang.org/stable/cargo/reference/lints.html) [#17298](rust-lang/cargo#17298) - Introduced minimum publish age configurations, also known as dependency cooldowns. When the relevant config is set, the resolver ignores versions published more recently than that, unless they are already in `Cargo.lock`. ([RFC 3923] (https://rust-lang.github.io/rfcs/3923-cargo-min-publish-age.html)) [docs] (https://doc.rust-lang.org/stable/cargo/reference/resolver.html#publish-age) [#17335] (rust-lang/cargo#17335) - cargo-install: now uses the existing lockfile in the `.crate` tarball by default. `--locked` in cargo install becomes a no-op. [#17388](rust-lang/cargo#17388) - Cargo now uses a new directory layout for intermediate build artifacts. Tools that inspect the build directory may need to use [Cargoâs JSON messages] (https://doc.rust-lang.org/stable/cargo/reference/external-tools.html#json-messages) to locate build artifacts instead of relying on the build directory layout. The layout is not a stable interface and is subject to change. ([build cache doc] (https://doc.rust-lang.org/stable/cargo/reference/build-cache.html)) [#17354](rust-lang/cargo#17354) Rustdoc ----- - [Add new `invalid_markdown_table` rustdoc lint] (rust-lang/rust#159583) Compatibility Notes ------------------- - [Closures now more precisely capture variables used in `if let`. This may cause new errors] (rust-lang/rust#154210) - [Check dyn-compatibility of trait objects in more places] (rust-lang/rust#154992) - [`Infallible` is now a type alias to `!`] (rust-lang/rust#155499) - [The never type fallback was changed to `!` on all editions] (rust-lang/rust#155499) - [`box` patterns are no longer syntactically allowed] (rust-lang/rust#156749) - [Report Query Cycle errors in more cases when computing the layout of enums with explicit discriminants] (rust-lang/rust#157562) - [Always escape grapheme extenders in `str::escape_debug`] (rust-lang/rust#158303) - [Make let-else respect `macro_rules` `expr` metavariable grouping] (rust-lang/rust#158515) - [`Iterator::{min,max}(_by_key)` changed which `Ord` methods they use.] (rust-lang/rust#160203) This cannot change behaviour (other than being potentially faster) for types correctly following the [`Ord` rules] (https://doc.rust-lang.org/std/cmp/trait.Ord.html), but may impact types with inconsistent trait implementations. - [Emit an error when trying to enable SSE/AVX on an x86 (32bit or 64bit) softfloat target] (rust-lang/rust#160302) - [Require windowed (and exception) for Xtensa ABI] (rust-lang/rust#160643) - [windows-gnullvm: always link libunwind statically] (rust-lang/rust#160712) - [From version 1.94 up to 1.100 a number of ARMv7-A hardfloat targets required the `VFPv3-D32` FPU as a minimum, as they erroneously had the `d32` feature in their baseline list of features. Breakage introduced as a result of correcting this can be fixed by passing `-Ctarget-feature=+d32` to Rust.] (rust-lang/rust#160911) - [Change "Rust" ABI on x86 to use SSE registers if they are always-available for the current target] (rust-lang/rust#161583) - [Make the `ambiguous_glob_imported_traits` lint fire in slightly more cases] (rust-lang/rust#161805) - [Make `+fix-cortex-a53-835769` a default feature for `aarch64-unknown-fuchsia`] (rust-lang/rust#161886) - [Some impls on `Box` have been generalised to arbitrary allocators, which may cause new type inference errors] (rust-lang/rust#161946) - [The standard library now uses Unicode version 18.0.0] (https://doc.rust-lang.org/stable/std/primitive.char.html#associatedconstant.UNICODE_VERSION) - [WASI SDK version was bumped from 33 to 34] (rust-lang/rust#163809) - [On ARM targets, `-Ctarget-feature`/`-Ctarget-cpu` values that would alter the ABI are rejected as hard errors now.] (rust-lang/rust#161280) Other ----- - [Test harness now allows passing `--test-threads` and `--color` multiple times, with later arguments overriding earlier ones] (rust-lang/rust#161312)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rust](https://rust-lang.org/) ([source](https://github.com/rust-lang/rust), [changelog](https://github.com/rust-lang/rust/blob/main/RELEASES.md)) | tools | minor | `1.99.1` → `1.100.0` | | [rust](https://hub.docker.com/_/rust) ([source](https://github.com/rust-lang/docker-rust)) | stage | minor | `1.99-slim-trixie` → `1.100-slim-trixie` | | [rust](https://hub.docker.com/_/rust) ([source](https://github.com/rust-lang/docker-rust)) | final | minor | `1.99-slim-trixie` → `1.100-slim-trixie` | --- ### Release Notes <details> <summary>rust-lang/rust (rust)</summary> ### [`v1.100.0`](https://github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-11000-2026-11-12) [Compare Source](rust-lang/rust@1.99.1...1.100.0) \========================== <a id="1.100.0-Language"></a> ## Language - [Stabilize never type](rust-lang/rust#155499) - [Lint against repeated `#[repr(..)]` attributes](rust-lang/rust#157036) - [Stabilize `extern "custom"`](rust-lang/rust#158504) - [Extend `dropping_references`, `dropping_copy_types` and `undropped_manually_drops` lints to `drop_in_place`](rust-lang/rust#160229) - [`unfulfilled_lint_expectations` no longer fires on `#[expect(dead_code)]` inside code that is covered by a dead parent's diagnostic](rust-lang/rust#161005) - [Turn the error for `repr(align)` fields in a `repr(packed)` type into a deny-by-default lint `aligned_fields_in_packed`](rust-lang/rust#162160) - [volatile: allow accesses to non-AM memory to trap](rust-lang/rust#160564) <a id="1.100.0-Compiler"></a> ## Compiler - [Stabilize `-Cprofile-sample-use`](rust-lang/rust#155942) - [Enable next solver by default in orphanck](rust-lang/rust#160668) <a id="1.100.0-Platform-Support"></a> ## Platform Support - [`i686-pc-windows-gnu` is now a tier 2 without host tools target](rust-lang/rust#161681) - [Promote `wasm32-wasip3` to Tier 2](rust-lang/rust#161940) - [Add new Tier 3 target `powerpc64-sony-ps3`](rust-lang/rust#162072) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. [platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html <a id="1.100.0-Libraries"></a> ## Libraries - [Stabilize custom allocators](rust-lang/rust#156882) - [Map `ENOTSUP` to `ErrorKind::Unsupported`](rust-lang/rust#158580) - [Fix soundness issues in `std::sys::pal::sgx::waitqueue::unsafe_list`](rust-lang/rust#161334) <a id="1.100.0-Stabilized-APIs"></a> ## Stabilized APIs - [`impl PartialEq<Cow<'_, [U]>> for Vec<T, A>`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#impl-PartialEq%3CCow%3C'_,+%5BU%5D%3E%3E-for-Vec%3CT,+A%3E) - [`impl PartialEq<Cow<'_, [U]>> for &[T]`](https://doc.rust-lang.org/stable/std/primitive.slice.html#impl-PartialEq%3CCow%3C'_,+%5BU%5D%3E%3E-for-%26%5BT%5D) - [`impl PartialEq<Cow<'_, [U]>> for &mut [T]`](https://doc.rust-lang.org/stable/std/primitive.slice.html#impl-PartialEq%3CCow%3C'_,+%5BU%5D%3E%3E-for-%26mut+%5BT%5D) - [`std::alloc::Allocator`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html) - [`std::alloc::Global`](https://doc.rust-lang.org/stable/std/alloc/struct.Global.html) - [`std::alloc::System`](https://doc.rust-lang.org/stable/std/alloc/struct.System.html) - [`impl Allocator for Global`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Global) - [`impl Allocator for System`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-System) - [`impl<A: Allocator> Allocator for &A`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-%26A) - [`impl<T: Allocator, A: Allocator> Allocator for Box<T, A>`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Box%3CT,+A%3E) - [`impl<A: Allocator> Allocator for &mut A`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-%26mut+A) - [`impl<T: Allocator, A: Allocator> Allocator for Arc<T, A>`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Arc%3CT,+A%3E) - [`impl<T: Allocator, A: Allocator> Allocator for Rc<T, A>`](https://doc.rust-lang.org/stable/std/alloc/trait.Allocator.html#impl-Allocator-for-Rc%3CT,+A%3E) - [`Box::new_in`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.new_in) - [`Box::from_raw_in`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.from_raw_in) - [`Box::from_non_null_in`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.from_non_null_in) - [`Box::into_raw_with_allocator`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.into_raw_with_allocator) - [`Box::into_non_null_with_allocator`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.into_non_null_with_allocator) - [`Box::allocator`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.allocator) - [`Vec::new_in`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.new_in) - [`Vec::with_capacity_in`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.with_capacity_in) - [`Vec::from_raw_parts_in`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.from_raw_parts_in) - [`Vec::from_parts_in`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.from_parts_in) - [`Vec::into_raw_parts_with_allocator`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.into_raw_parts_with_allocator) - [`Vec::into_parts_with_allocator`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.into_parts_with_allocator) - [`Vec::allocator`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.allocator) - [`Child::main_thread_handle`](https://doc.rust-lang.org/stable/std/os/windows/process/trait.ChildExt.html#tymethod.main_thread_handle) - [`impl Default for std::sync::Once`](https://doc.rust-lang.org/stable/std/sync/struct.Once.html#impl-Default-for-Once) - [`bool::toggle`](https://doc.rust-lang.org/stable/std/primitive.bool.html#method.toggle) - [`Box::take`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.take) - [`Box::map`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#method.map) - [`Rc::map`](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.map) - [`Arc::map`](https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.map) - [`impl AsRef<T> for !`](https://doc.rust-lang.org/stable/std/primitive.never.html#impl-AsRef<T>-for-!) - [`impl AsMut<T> for !`](https://doc.rust-lang.org/stable/std/primitive.never.html#impl-AsMut<T>-for-!) - [`core::mem::DropGuard`](https://doc.rust-lang.org/stable/core/mem/struct.DropGuard.html) - [`core::mem::conjure_zst`](https://doc.rust-lang.org/stable/core/mem/fn.conjure_zst.html) - [`UnsafeCell::replace`](https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.replace) - [`UnsafeCell::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.as_ref_unchecked) - [`UnsafeCell::as_mut_unchecked`](https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.as_mut_unchecked) - [`str::trim_prefix`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.trim_prefix) - [`str::trim_suffix`](https://doc.rust-lang.org/stable/std/primitive.str.html#method.trim_suffix) - [`[T]::trim_prefix`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.trim_prefix) - [`[T]::trim_suffix`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.trim_suffix) - [`Path::trim_prefix`](https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.trim_prefix) - [`Vec::from_fn`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.from_fn) - [`os::windows::process::CommandExt::show_window`](https://doc.rust-lang.org/stable/std/os/windows/process/trait.CommandExt.html#tymethod.show_window) <a id="1.100.0-Cargo"></a> ## Cargo - Introduced Cargo's own linting system: some Cargo warnings are now emitted as lints that users can control in the `[lints.cargo]` table. This includes a new built-in unused dependency check via the `cargo::unused_dependencies` lint. [docs](https://doc.rust-lang.org/stable/cargo/reference/lints.html) [#​17298](rust-lang/cargo#17298) - Introduced minimum publish age configurations, also known as dependency cooldowns. When the relevant config is set, the resolver ignores versions published more recently than that, unless they are already in `Cargo.lock`. ([RFC 3923](https://rust-lang.github.io/rfcs/3923-cargo-min-publish-age.html)) [docs](https://doc.rust-lang.org/stable/cargo/reference/resolver.html#publish-age) [#​17335](rust-lang/cargo#17335) - cargo-install: now uses the existing lockfile in the `.crate` tarball by default. `--locked` in cargo install becomes a no-op. [#​17388](rust-lang/cargo#17388) - Cargo now uses a new directory layout for intermediate build artifacts. Tools that inspect the build directory may need to use [Cargo’s JSON messages](https://doc.rust-lang.org/stable/cargo/reference/external-tools.html#json-messages) to locate build artifacts instead of relying on the build directory layout. The layout is not a stable interface and is subject to change. ([build cache doc](https://doc.rust-lang.org/stable/cargo/reference/build-cache.html)) [#​17354](rust-lang/cargo#17354) ## Rustdoc - [Add new `invalid_markdown_table` rustdoc lint](rust-lang/rust#159583) <a id="1.100.0-Compatibility-Notes"></a> ## Compatibility Notes - [Closures now more precisely capture variables used in `if let`. This may cause new errors](rust-lang/rust#154210) - [Check dyn-compatibility of trait objects in more places](rust-lang/rust#154992) - [`Infallible` is now a type alias to `!`](rust-lang/rust#155499) - [The never type fallback was changed to `!` on all editions](rust-lang/rust#155499) - [`box` patterns are no longer syntactically allowed](rust-lang/rust#156749) - [Report Query Cycle errors in more cases when computing the layout of enums with explicit discriminants](rust-lang/rust#157562) - [Always escape grapheme extenders in `str::escape_debug`](rust-lang/rust#158303) - [Make let-else respect `macro_rules` `expr` metavariable grouping](rust-lang/rust#158515) - [`Iterator::{min,max}(_by_key)` changed which `Ord` methods they use.](rust-lang/rust#160203) This cannot change behaviour (other than being potentially faster) for types correctly following the [`Ord` rules](https://doc.rust-lang.org/std/cmp/trait.Ord.html), but may impact types with inconsistent trait implementations. - [Emit an error when trying to enable SSE/AVX on an x86 (32bit or 64bit) softfloat target](rust-lang/rust#160302) - [Require windowed (and exception) for Xtensa ABI](rust-lang/rust#160643) - [windows-gnullvm: always link libunwind statically](rust-lang/rust#160712) - [From version 1.94 up to 1.100 a number of ARMv7-A hardfloat targets required the `VFPv3-D32` FPU as a minimum, as they erroneously had the `d32` feature in their baseline list of features. Breakage introduced as a result of correcting this can be fixed by passing `-Ctarget-feature=+d32` to Rust.](rust-lang/rust#160911) - [Change "Rust" ABI on x86 to use SSE registers if they are always-available for the current target](rust-lang/rust#161583) - [Make the `ambiguous_glob_imported_traits` lint fire in slightly more cases](rust-lang/rust#161805) - [Make `+fix-cortex-a53-835769` a default feature for `aarch64-unknown-fuchsia`](rust-lang/rust#161886) - [Some impls on `Box` have been generalised to arbitrary allocators, which may cause new type inference errors](rust-lang/rust#161946) - [The standard library now uses Unicode version 18.0.0](https://doc.rust-lang.org/stable/std/primitive.char.html#associatedconstant.UNICODE_VERSION) - [WASI SDK version was bumped from 33 to 34](rust-lang/rust#163809) - [On ARM targets, `-Ctarget-feature`/`-Ctarget-cpu` values that would alter the ABI are rejected as hard errors now.](rust-lang/rust#161280) <a id="1.100.0-Internal-Changes"></a> ## Other - [Test harness now allows passing `--test-threads` and `--color` multiple times, with later arguments overriding earlier ones](rust-lang/rust#161312) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 9am on tuesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjcuNCIsInVwZGF0ZWRJblZlciI6IjQ0LjIyNy40IiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2356 Reviewed-by: Thomas de Zeeuw <[email protected]>
Upgrade the rust toolchain from 1.99.1 to 1.100.0. See: https://blog.rust-lang.org/2026/11/12/Rust-1.100.0/. The `cargo clippy` fixes this needs are in the PR below this one in the stack (dfinity#12142). This PR is therefore the version bump in `rust-toolchain.toml` and `bazel/rust.MODULE.bazel`, plus: * checksums for the 1.100.0 archives our builds download, which rules_rust 0.75.0 doesn't have, * the removal of the `clippy::double_must_use` allow, which 1.100.0 no longer needs, * an off-by-one fix in the `subnet_splitting` integration test that 1.100.0's codegen exposes, * the test data that the new codegen shifts. ## Canbench Five of the eight canbench suites moved beyond their noise thresholds, all towards *fewer* instructions. Heap and stable-memory increases are unchanged everywhere, and only `instructions` lines changed in the results files. | suite | totals beyond the noise threshold | change of all totals | results file | | --- | --- | --- | --- | | ckBTC minter | 0 of 7 (but 7 scopes) | -0.26% to -0.74% | regenerated | | ckETH minter | 1 of 1 | -5.20% | regenerated | | ICRC-1 ledger (u64) | 1 of 2 (and 5 of its scopes) | -0.22% to -3.76% | regenerated | | ICRC-1 ledger (u256) | 1 of 2 (and 5 of its scopes) | -0.22% to -3.73% | regenerated | | registry | 2 of 14 | +0.10% to -5.34% | regenerated | | ICP ledger | 0 of 1 | -0.55% | unchanged | | NNS governance | 0 of 28 (5% threshold) | +1.67% to -2.11% | unchanged | | SNS governance | 0 of 1 | +0.01% | unchanged | **`//rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_test`** was regenerated with `bazel run //rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_update`. All 7 benchmark totals stay within the noise threshold (-0.26% to -0.74%), but 7 small `::greedy` scopes moved beyond it. They more than undo the +9% to +11% that 1.99.0 added to the same scopes (dfinity#11735): | status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% | |--------|----------------------------------------------------|-------|--------|---------|----|--------|-----|---------| | - | `build_unsigned_transaction_2_100k_sats::greedy` | 1 | 4.15K | -13.35% | 0 | 0.00% | 0 | 0.00% | | - | `build_estimate_retrieve_btc_fee_1_50k_sats::greedy` | 1 | 4.10K | -13.48% | 0 | 0.00% | 0 | 0.00% | | - | `build_unsigned_transaction_1_50k_sats::greedy` | 1 | 4.10K | -13.48% | 0 | 0.00% | 0 | 0.00% | | - | `build_unsigned_transaction_6_10_btc::greedy` | 1 | 11.50K | -14.29% | 0 | 0.00% | 0 | 0.00% | | - | `build_unsigned_transaction_4_10m_sats::greedy` | 1 | 3.81K | -14.38% | 0 | 0.00% | 0 | 0.00% | | - | `build_unsigned_transaction_5_1_btc::greedy` | 1 | 3.81K | -14.38% | 0 | 0.00% | 0 | 0.00% | | - | `build_unsigned_transaction_3_1m_sats::greedy` | 1 | 2.62K | -20.09% | 0 | 0.00% | 0 | 0.00% | **`//rs/ethereum/cketh/minter:cketh_minter_canbench_test`** was regenerated with `bazel run //rs/ethereum/cketh/minter:cketh_minter_canbench_update`. Its only benchmark moved beyond the noise threshold: | status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% | |--------|--------------------|-------|-------|---------|-----|--------|-----|---------| | - | `bench_post_upgrade` | | 1.14B | -5.20% | 290 | 0.00% | 0 | 0.00% | **`//rs/ledger_suite/icrc1/ledger:canbench_u64_test`** and **`:canbench_u256_test`** were regenerated with `bazel run //rs/ledger_suite/icrc1/ledger:canbench_u64_update` and `:canbench_u256_update`. Both moved the same way. u64: | status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% | |--------|-----------------------------------------------|-------|---------|---------|-----|--------|-----|---------| | - | `bench_icrc1_transfers` | | 48.23B | -3.76% | 264 | 0.00% | 256 | 0.00% | | - | `bench_icrc1_transfers::icrc2_transfer_from` | 1 | 18.87B | -4.76% | 3 | 0.00% | 0 | 0.00% | | - | `bench_icrc1_transfers::upgrade` | 1 | 473.43M | -4.91% | 202 | 0.00% | 128 | 0.00% | | - | `bench_icrc1_transfers::icrc2_approve` | 1 | 16.78B | -5.65% | 28 | 0.00% | 128 | 0.00% | | - | `bench_icrc1_transfers::post_upgrade` | 1 | 323.70M | -6.73% | 73 | 0.00% | 0 | 0.00% | | - | `bench_icrc1_transfers::icrc103_get_allowances` | 1 | 3.94M | -26.26% | 0 | 0.00% | 0 | 0.00% | u256: | status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% | |--------|-----------------------------------------------|-------|---------|---------|-----|--------|-----|---------| | - | `bench_icrc1_transfers` | | 49.77B | -3.73% | 262 | 0.00% | 256 | 0.00% | | - | `bench_icrc1_transfers::icrc2_transfer_from` | 1 | 19.32B | -4.72% | 3 | 0.00% | 0 | 0.00% | | - | `bench_icrc1_transfers::upgrade` | 1 | 468.90M | -4.75% | 200 | 0.00% | 128 | 0.00% | | - | `bench_icrc1_transfers::icrc2_approve` | 1 | 17.32B | -5.58% | 28 | 0.00% | 128 | 0.00% | | - | `bench_icrc1_transfers::post_upgrade` | 1 | 318.12M | -6.85% | 71 | 0.00% | 0 | 0.00% | | - | `bench_icrc1_transfers::icrc103_get_allowances` | 1 | 4.84M | -22.50% | 0 | 0.00% | 0 | 0.00% | **`//rs/registry/canister:registry-canbench_test`** was regenerated with `bazel run //rs/registry/canister:registry-canbench_update`. Two of its 14 benchmarks moved beyond the noise threshold: | status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% | |--------|-------------------------------------------------------------|-------|---------|---------|-----|--------|-----|---------| | - | `get_subnet_for_canister_100_times_100` | | 27.17M | -3.28% | 0 | 0.00% | 0 | 0.00% | | - | `measure_routing_table_invariant_checks_shards_and_unsharded` | | 211.57M | -5.34% | 138 | 0.00% | 0 | 0.00% | The other three suites (ICP ledger, NNS governance, SNS governance) stay within their noise thresholds, so their results files are unchanged. ## `subnet_splitting` **`//rs/recovery/subnet_splitting:integration_test`** has no `_update` target, and it needed two commits: 1. **A bound fix.** On 1.100.0 the split-finder's optimal split uses all 10 allowed cuts, and puts both the first and the last canister on the side it reports, so it reports 6 ranges. The test allowed only `MAX_CUTS.div_ceil(2)` = 5. But 10 cuts make up to 11 segments that alternate between the two subnets, so one side can get 6 of them. The test now allows `MAX_CUTS / 2 + 1`, and its failure message gives that bound and the ranges (it used to say "at most 10"). 2. **A re-pin.** All ten expected values were re-pinned by hand from one 1.100.0 reference run, in that run's source/destination orientation. As with 1.99.0 (dfinity#11735), what changed is the *partition*, not the workload: * Every total is identical: canisters 20, ingress messages 39, remote 10, local 28, http outcalls 10, heartbeats 694. Total instructions moved by 0.004% and total state size by 0.23%. * Both partitions balance instructions ~50/50, which the test also checks. Source / destination as each run reports them (which group is which is arbitrary): | metric | 1.99.1 | 1.100.0 | | --- | --- | --- | | `states_sizes_bytes` | 3712908 / 5569325 | 5044173 / 4259662 | | `instructions_executed` | 144307301 / 145741551 | 145713211 / 144348562 | | `canisters_installed` | 8 / 12 | 11 / 9 | | `ingress_messages_executed` | 15 / 24 | 21 / 18 | | `remote_subnet_messages_executed_lower_bound` | 4 / 6 | 5 / 5 | | `local_subnet_messages_executed_upper_bound` | 11 / 17 | 15 / 13 | | `http_outcalls_executed` | 4 / 6 | 6 / 4 | | `heartbeats_and_global_timers_executed` | 368 / 326 | 341 / 353 | The test is deterministic: 3/3 uncached runs on 1.100.0 give identical estimates. But it pins the exact solution of a degenerate optimisation, and it has now been re-pinned six times since September, mostly for unrelated changes (dfinity#11171, dfinity#11534, dfinity#11735, dfinity#11774, dfinity#12043, dfinity#11932). Asserting on the totals and on the ~50/50 instruction balance would make it robust. ## Clippy allows `ci/scripts/rust-lint.sh` and the PocketIC Windows lint (`.github/workflows/pocket-ic-tests-windows.yml`) no longer pass `--allow clippy::double_must_use`, and `rust-lint.sh` drops the comment that explained both allows. Clippy 0.1.100 ships the fix for the `#[async_trait]` false positive ([rust-lang/rust-clippy#17547](rust-lang/rust-clippy#17547)), and without the allow the lint reports nothing in the workspace. `redundant_field_names` stays allowed: 0.1.100 still flags the same 41 sites in thiserror and derive-new output, and the fix ([rust-lang/rust#164816](rust-lang/rust#164816)) ships in 1.101. ## Toolchain checksums and repin rules_rust 0.75.0 (released 2026-10-26, still the latest) ships checksums for 1.99.1 but not for 1.100.0, and it downloads an archive unverified when it has no checksum for it. So `rust.toolchain` now passes `sha256s` for the 21 archives of 1.100.0 that builds on our supported hosts (`aarch64-apple-darwin`, `aarch64-unknown-linux-gnu` and `x86_64-unknown-linux-gnu`) download between them: * `rustc`, `cargo`, `clippy`, `llvm-tools` and `rust-analyzer` for each of the three hosts * `rust-std` for the three hosts and for the targets they cross-compile to: `wasm32-unknown-unknown`, and `x86_64-apple-darwin`, which the darwin CI job builds `pocket-ic-server` for (`--platforms=//:macos-intel`) * `rust-src` rules_rust also registers toolchains for 8 other hosts and for the `wasm32-wasip1` and `wasm32-wasip2` targets. But Bazel only downloads a toolchain when a build selects it, and our builds never select those. Neither does CI's target selection: its `rdeps(//..., …)` queries load the closure of `bazel query 'deps(//...)'`, which contains none of the Rust toolchain repositories. A build on another host, or for a new target, would download those archives unverified, so the comment above the dict says what to add when supporting one. An exception on a supported host: building `//:rustfmt` (alone or as part of `//...`) with `--platforms=//:macos-intel` also fetches the `x86_64-apple-darwin` tools unverified, because rules_rust's rustfmt rule makes the target platform an execution platform. Nothing in the repo or CI does that. The checksums are the `xz_hash`es from the GPG-signed `channel-rust-1.100.0.toml`. They match the `.sha256` files at the exact URLs rules_rust downloads from, and the archives themselves, each of which has a valid signature. The dict can go once a rules_rust release ships these checksums. A key that doesn't match what rules_rust looks up is silently ignored, so the keys were checked against Bazel too: * Force-fetching the 8 toolchain repositories those builds use, through an empty repository cache, downloads and verifies 19 of the 21 archives on x86_64 Linux. The other 2 are `rust-analyzer` for the two arm64 hosts, which only those hosts fetch. None of them triggers the "canonical reproducible form" DEBUG message that Bazel prints when a rules_rust toolchain repository downloads an archive it has no checksum for. As a control, the `wasm32-wasip2` repository, which our builds don't use, does: the `sha256s` it suggests adds its `rust-std`, which isn't in the dict. * Corrupting a single checksum makes the fetch fail with `Checksum was … but wanted …`. Tried for `rust-std` for `x86_64-apple-darwin` and `wasm32-unknown-unknown`, `rustc` for `aarch64-unknown-linux-gnu`, `llvm-tools` for `aarch64-apple-darwin`, and `rust-analyzer` for `x86_64-unknown-linux-gnu`. * On x86_64 Linux, `bazel build //... --nobuild` fetches no Rust toolchain archive without a checksum. No repin is needed. The `Cargo.Bazel.*.lock` digests hash the `cargo`/`rustc` of rules_rust's own host tools (1.99.1 in rules_rust 0.75.0), not the version selected by `rust.toolchain`, and no third-party crate changed. Bazel accepts the existing lock files. ## Also checked, since tests won't necessarily catch these * **Never type** ([rust#155499](rust-lang/rust#155499)): `!` is stable, `Infallible` is now an alias for it, and the never-type fallback is `!` on all editions. Only 5 crates are not on edition 2024 under Cargo (`rate_limits` and four `guest_upgrade` crates; Bazel already builds them as 2024), and they compile cleanly. The only `impl From<Infallible>` (`ic-protobuf`'s `ProxyDecodeError`) compiles too. * **`Iterator::{min,max}(_by_key)`** ([rust#160203](rust-lang/rust#160203)) now call `Ord::{min,max}` and `PartialOrd::{lt,le,gt,ge}`, so they can only behave differently for types that override those inconsistently with `cmp`. No first-party type overrides them. * **Wasm and LLVM**: the `wasm32-unknown-unknown` target spec is identical on both toolchains, and LLVM stays on 23 (23.1.1 → 23.1.5), so the LLVM-bitcode caveat from dfinity#11735 is unchanged. * **Cargo's build-directory layout** changed. The only code that parses build paths, `canister_sandbox`'s profile detection, matches `/target/<profile>/` and still does. Bazel is unaffected. * **Cargo's new `[lints.cargo]`**: the warn-by-default `unused_dependencies` lint now reports 30 dependencies in 24 manifests during `cargo clippy --workspace --all-targets`, plus an unused workspace dependency (`ring`) and a redundant `homepage` (`ic-management-canister-types`). These are warnings, so CI doesn't fail on them. Some are false positives: the lint only sees the host target, so dependencies used only on `wasm32`, like `ic-dummy-getrandom-for-wasm`, look unused. This PR leaves them to their owners. * **rustfmt**: stable 1.11.0 accepts the tree unchanged. ## Testing * `./ci/scripts/rust-lint.sh` exits 0 on 1.100.0. * All 8 canbench tests and the `subnet_splitting` integration test pass. * `bazel build` of all 2,091 Rust targets, including the 110 wasm canisters, succeeds on 1.100.0. That covers the `wasm32`-only code and Bazel-only crates that `cargo clippy` doesn't see. * `bazel build //... --nobuild` analyzes all 3,387 targets, and buildifier is clean. * After merging dfinity#12142's review changes, on 1.100.0: `rust-lint.sh`, `cargo check` of `ic-sns-governance` and `ic-admin`, and `bazel build` of the 6 directly affected targets pass, and so do 60 of the 61 non-system tests within two hops of the changed files. The other one, `golden_state_swap_upgrade_twice`, can't fetch its golden state over SSH from the dev environment. * CI with `CI_ALL_BAZEL_TARGETS` passed on 5546a65. The commits since (the checksums, the `rust-lint.sh` comment and the merged dfinity#12142 review changes) get the default diff-based CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Two related changes to provided Iterator implementations:
Iterator::minandIterator::maxare currently implemented viamin_byandmax_by, which means they don't useOrd::{min,max}despite those being overridable to do something more efficient. Move these to just being.reduce(Ord::min)and.reduce(Ord::max)to take advantage of potential overrides.Iterator::min_by_keyandIterator::max_by_keyare implemented by mapping to a tuple then usingmin_by/max_bywith a comparator that only looks at one field in the tuple. That means they end up doing things likea.cmp(b).is_le(), which is wasteful if there an overloaded-> boolmethod it could use instead. So rephrase these two to work as.map(…).min()/.map(…).max()by mapping to a type that's not a tuple and which can thus override more things instead of just passing aFn(…) -> Ordering.