Skip to content

chore: update rust to 1.88.0 - #6045

Merged
kpop-dfinity merged 21 commits into
masterfrom
kpop/rust_1_88
Aug 5, 2025
Merged

kpop-dfinity merged 21 commits into
masterfrom
kpop/rust_1_88

Conversation

@kpop-dfinity

@kpop-dfinity kpop-dfinity commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

Changes

  1. Removed long deprecated rls component, since it's been removed from rust in 1.87.0
  2. disabled uninlined_format_args check - otherwise I would have to change essentially every file in the repo in this PR... - note that the lint has been moved back to pedantic in the cargo clippy, so the problem will eventually go away, but it is still an issue in this version of rust (1.88.0). See also uninlined_format_args should have stayed in pedantic rust-lang/rust-clippy#15151
  3. Explicitly ignored result_large_err warnings - I'll leave it up to the code owners whether/how to fix the warnings
  4. Modified the backtrace message in rs/execution_environment/tests/backtraces.rs
  5. Bumped max compressed wasm size of some nns canisters from 1.5MB to 1.6MB in file_size_check tests
  6. Fixed io_other_error warnings
  7. Fixed iter_kv_map warnings
  8. Fixed manual_contains warnings
  9. Fixed some other, rarely occurring, clippy warnings

Benchmarks updates

//rs/ledger_suite/icrc1/ledger:canbench_u256

Only significant changes:

status name calls ins ins Δ% HI HI Δ% SMI SMI Δ%
+ bench_icrc1_transfers::post_upgrade 1 365.33M +3.75% 71 0.00% 0 0.00%
+ bench_icrc1_transfers::upgrade 1 516.12M +3.17% 200 0.00% 128 0.00%

ins = instructions, HI = heap_increase, SMI = stable_memory_increase, Δ% = percent change

//rs/ledger_suite/icrc1/ledger:canbench_u64

Only significant changes:

status name calls ins ins Δ% HI HI Δ% SMI SMI Δ%
+ bench_icrc1_transfers::icrc2_approve 1 18.44B -0.22% 29 +16.00% 128 0.00%
- bench_icrc1_transfers::icrc1_transfer 1 12.24B -0.50% 31 -8.82% 0 0.00%
- bench_icrc1_transfers::icrc2_transfer_from 1 20.57B -0.54% 3 -25.00% 0 0.00%

ins = instructions, HI = heap_increase, SMI = stable_memory_increase, Δ% = percent change

//rs/nns/governance:governance-canbench

Only significant changes:

status name calls ins ins Δ% HI HI Δ% SMI SMI Δ%
+ add_neuron_inactive_maximum 64.86M +5.79% 0 0.00% 0 0.00%
+ add_neuron_active_maximum_stable 64.86M +5.79% 0 0.00% 0 0.00%
- list_neurons_stable 63.04M -5.65% 9 0.00% 0 0.00%
- list_neurons_by_subaccount_stable 62.12M -5.67% 5 0.00% 0 0.00%
- range_neurons_performance 51.56M -6.28% 0 0.00% 0 0.00%

ins = instructions, HI = heap_increase, SMI = stable_memory_increase, Δ% = percent change

@github-actions

Copy link
Copy Markdown
Contributor

Run URL: https://github.com/dfinity/ic/actions/runs/16491669432

New container image: sha256:4e413cc86bac97c7077a9c7857b7ba1ab2e2c8104697f863585ad0ce70aab41f
New container tag: 81b0a98486c17991e211deda54c717bfff6427ff14924bf746d5f8fd6cfb9179

@kpop-dfinity kpop-dfinity added the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Jul 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Run URL: https://github.com/dfinity/ic/actions/runs/16492087374

New container image: sha256:a5edec0ae2b045ef86bc957f9a3155a360edc2a273a700eabd0670dc489d809c
New container tag: 16e06bf3c56bdcc50674a64be074337acee526d41ac785780ae4a9835a6a637b

@kpop-dfinity kpop-dfinity changed the title chore chore: update rust to 1.88.0 Jul 24, 2025
@github-actions github-actions Bot added the chore label Jul 24, 2025
kpop-dfinity and others added 9 commits July 25, 2025 08:09
…e2c8104697f863585ad0ce70aab41f

Image tag: 81b0a98486c17991e211deda54c717bfff6427ff14924bf746d5f8fd6cfb9179
…edc2a273a700eabd0670dc489d809c

Image tag: 16e06bf3c56bdcc50674a64be074337acee526d41ac785780ae4a9835a6a637b
IDX GitHub Automation and others added 2 commits July 25, 2025 08:17
* Fix
  `//rs/execution_environment:execution_environment_misc_integration_tests/backtraces_test`
  tests
* Fix `//publish/canisters:sns-governance-canister.wasm.gz_size_check`
  test
* Update benchmark reults
@kpop-dfinity
kpop-dfinity marked this pull request as ready for review July 25, 2025 15:45
@kpop-dfinity
kpop-dfinity requested review from a team as code owners July 25, 2025 15:45
@kpop-dfinity
kpop-dfinity requested a review from a team July 25, 2025 15:45
@kpop-dfinity
kpop-dfinity requested review from a team as code owners July 25, 2025 15:45
@kpop-dfinity
kpop-dfinity requested a review from a team July 25, 2025 15:45
@kpop-dfinity
kpop-dfinity dismissed github-actions[bot]’s stale review July 28, 2025 08:12

No canister behavior changes.

Comment thread rs/nns/integration_tests/BUILD.bazel Outdated
Comment thread rs/nns/governance/canbench/canbench_results.yml

@randombit randombit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crypto lgtm

@tojot-dfinity tojot-dfinity left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have probably added an explicit comment whenever added #[allow(clippy::result_large_err)], but I'm almost the last to approve, so won't block on that.

LGTM for Utopia

@kpop-dfinity
kpop-dfinity added this pull request to the merge queue Aug 5, 2025
Merged via the queue into master with commit a4c1c9b Aug 5, 2025
@kpop-dfinity
kpop-dfinity deleted the kpop/rust_1_88 branch August 5, 2025 08:09
valorjesson-commits pushed a commit to valorjesson-commits/ic that referenced this pull request Oct 3, 2026
… 1.99.0 (dfinity#11734)

`cargo clippy` fixes to prepare for upgrading to
[rustc-1.99.0](https://blog.rust-lang.org/2026/10/01/Rust-1.99.0/).

Clippy 0.1.99 and rustc 1.99.0 report diagnostics at **124 sites** that
1.98.1 does not, in 67
source files plus 5 tonic-generated ones. 107 of these sites are clippy
false positives in
macro-generated code; the other 17 are fixed in the code:

| lint | sites | why it fires now | fix |
| --- | --: | --- | --- |
|
[`double_must_use`](https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#double_must_use)
| 66 | [#16633](rust-lang/rust-clippy#16633)
makes clippy use rustc's `#[must_use]` determination. Clippy now sees
that the `Pin<Box<dyn Future>>` an `#[async_trait]` method returns is
already `#[must_use]`, and flags the `#[must_use]` that async-trait adds
to it. That hits every one of the 61 `#[async_trait]` traits in the
workspace, plus 5 tonic-generated ones (141 diagnostics, one per async
method) | `--allow` (see below) |
|
[`redundant_field_names`](https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#redundant_field_names)
| 41 | [#17294](rust-lang/rust-clippy#17294)
moved the macro check from the struct expression to its fields. In
derive output the fields' spans point at user code: thiserror's `From`
impl for `#[from] source` fields (16) and `derive_new::new` (25, all in
`ic_boundary`) | `--allow` (see below) |
| `deprecated` (rustc) | 13 |
[rust#148590](rust-lang/rust#148590) deprecates
`Atomic*::fetch_update` in favour of its new name `try_update` (3).
[rust#146882](rust-lang/rust#146882) fully
deprecates the legacy `std::f32`/`std::f64` module constants, which `use
std::f32;`/`use std::f64;` made `f32::NAN` etc. resolve to (10) |
`fetch_update` → `try_update`; drop `use std::f64;` from `metrics_proxy`
and `use std::f32;`/`use std::f64;` from `nan_canonicalized` (see below)
|
|
[`nonstandard_macro_braces`](https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#nonstandard_macro_braces)
| 3 | [#16808](rust-lang/rust-clippy#16808)
moved the lint from `nursery` to `style`, so `clippy::all` now enables
it | `format! {..}` / `write! {..}` → `format!(..)` / `write!(..)` |
|
[`single_element_loop`](https://rust-lang.github.io/rust-clippy/rust-1.99.0/index.html#single_element_loop)
| 1 | [#16513](rust-lang/rust-clippy#16513): now
also fires when the loop body is a single expression | `for (flag, s) in
[(sns, "sns")] { if flag.is_some() { .. } }` → `if sns.is_some() { .. }`
|

Three of these deserve a word:

* **`double_must_use` and `redundant_field_names` are allowed globally**
rather than at each site,
both in `ci/scripts/rust-lint.sh` and in the second clippy gate, the
PocketIC Windows lint
(`.github/workflows/pocket-ic-tests-windows.yml`). Its `cargo clippy -p
pocket-ic` also lints
pocket-ic's workspace path dependencies, which include `#[async_trait]`
traits. The lints flag code
that the macros generate, not code anyone wrote. Per-site `#[allow]`s
would touch 64 files across
most teams: the 59 with flagged code plus the 5 that include
tonic-generated code. Every new
`#[async_trait]` trait, `#[from] source` field or `#[derive(new)]`
struct would then need one too.
- The trade-off: until the allows are removed, both lints also stop
catching hand-written code.
  - Clippy has already fixed the first one
([#17547](rust-lang/rust-clippy#17547), merged
after 1.99 branched, so
    it ships in 1.100). The second is still open as
    [#17525](rust-lang/rust-clippy#17525).
- Upgrading the macros instead is not an option. async-trait 0.1.92 and
thiserror 2.0.20 do
suppress the lints in their output, but both require syn 3, which this
repo deliberately avoids
(`thiserror = "=2.0.18"`, dfinity#11016). derive-new has had no release since
0.7.0.
- This is how the 1.88 upgrade (dfinity#6045) handled `uninlined_format_args`.

The Windows workflow's path filter now also matches
`rust-toolchain.toml`, so a toolchain bump
(like the PR stacked on this one) runs the Windows lint and tests before
it merges, rather than
  first in the next daily run on master.

* **`use std::f32;` / `use std::f64;`** bring the *module* into scope.
For names that exist in that
module it shadows the primitive type. So `f64::INFINITY` resolved to the
deprecated
`std::f64::INFINITY` rather than the associated constant on `f64` (same
value), while `f64::ln`
and the like fell through to the primitive type. Without the imports
every `f32::…`/`f64::…` path
  in those two files resolves to the primitive type.

* **`try_update`** is `fetch_update` under its new name: same arguments,
same result. It has been
stable since 1.95, so it also builds on the currently pinned toolchain.

Because this PR lands *before* the toolchain bump, it has to stay clean
on 1.98.1 too. It does not
name any lint that is new in 1.99: both allowed lints exist in Clippy
0.1.98, so there is no
`unknown_lints` issue. It also uses no API that 1.98.1 lacks.

The toolchain upgrade itself is the PR stacked on top of this one.

## Testing

* `./ci/scripts/rust-lint.sh` exits 0 both on the currently pinned
**1.98.1** and on **1.99.0**.
* On 1.98.1, these pass:
  * `cargo check --all-targets --all-features` of the 7 touched crates
  * `bazel build` of the 8 directly affected targets
* Of the 464 tests that depend on the touched files within two hops, 459
passed locally before the
run was stopped in favour of CI, which passes on all targets
(`CI_ALL_BAZEL_TARGETS`). The 3 local
  failures are environmental:
* two golden-state tests: `golden_state_swap_upgrade_twice` cannot fetch
its state over SSH from
the dev environment, and `upgrade_canisters_with_golden_nns_state` needs
    `NNS_CANISTER_UPGRADE_SEQUENCE`
  * a cketh minter test timed out under full machine load

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.