ADR-T-003: Preparing for Rust Edition 2024

April 16, 2026 · View on GitHub

Status: Decided Date: 2026-03-23 Relates to: ADR-T-001 (root crate conventions)

Context

Rust edition 2024 (stabilised in Rust 1.85) introduces language and library changes that affect compilation. Although the workspace still targets edition = "2021", several transitive dependencies have already published releases that set edition = "2024" in their own Cargo.toml. Those crates require rustc >= 1.85 to compile.

This creates a conflict: keeping the workspace on edition 2021 is desirable until all first-party code is migrated, but the latest versions of some dependencies can no longer build on the previous MSRV (1.80).

Even after downgrading every edition-2024 crate, the remaining dependency tree still requires at least rustc 1.83 due to non-edition MSRV bumps in transitive crates:

Minimum rustcCrates (examples)
1.83async-compression, compression-codecs, crc, icu_*, pest*
1.82axum-server, idna_adapter, indexmap, serde_with, yoke, zerovec
1.81base64ct, derive_more, zerofrom

Since 1.83 is the highest floor in that set, it becomes the new MSRV.

Options Considered

OptionStrategyEdition compatRisk
A. Pin deps, raise MSRV to 1.83Downgrade or pin every transitive dep that requires edition 2024; stay on edition 2021All deps build under 2021Pins will drift; must be actively maintained until the full migration
B. Jump straight to edition 2024Bump edition = "2024" workspace-wide, require rustc >= 1.85NativeLarge migration surface — all first-party code must pass 2024 lints in one step
C. Stay on current MSRV (1.80)Pin even more aggressively, avoid the 1.81–1.83 crates tooAll deps build under 2021 on 1.80Too many pins; some crates have no viable older version

Option C was rejected because the transitive dependency floor at 1.83 cannot be avoided without forking crates. Option B is the end goal but premature — edition 2024 migration should be a separate, focused ADR. Option A buys time for that migration.

Decision

Option A — Pin or downgrade affected transitive dependencies so the entire dependency tree compiles under edition 2021 with a raised MSRV of 1.83.

Direct dependency changes

Setting / CrateFromToReason
rust-version1.801.83Highest MSRV required by transitive deps
jsonwebtoken10 (with rust_crypto)9.3v10 pulls simple_asn1 0.6.4 -> time 0.3.47 (edition 2024)
rand0 (resolved to 0.10)0.9rand 0.10 depends on rand_core 0.10 (edition 2024)

Cargo.lock downgrades

The following crates were pinned to older versions to avoid edition-2024-only releases in the lock file:

CrateFromToChain
time0.3.470.3.41time-core 0.1.8 -> edition 2024
time-core0.1.80.1.4edition 2024
time-macros0.2.270.2.22pulled by time
deranged0.5.80.4.0pulled by time
num-conv0.2.00.1.0pulled by time
simple_asn10.6.40.6.3required time ^0.3.47
serde_with3.18.03.17.0required time ~0.3.47
serde_with_macros3.18.03.17.0pulled by serde_with
darling0.23.00.21.3pulled by serde_with
darling_core0.23.00.21.3pulled by darling
darling_macro0.23.00.21.3pulled by darling
clap4.6.04.5.61edition 2024
clap_builder4.6.04.5.61pulled by clap
clap_derive4.6.04.5.61pulled by clap
clap_lex1.1.01.0.1edition 2024
globset0.4.180.4.15edition 2024
ignore0.4.250.4.22required globset ^0.4.18
home0.5.120.5.11edition 2024
image0.25.100.25.6removed moxcms/pxfm (edition 2024)
png0.18.10.17.16pulled by image
jsonwebtoken10.3.09.3.1direct change (see above)
quickcheck1.1.01.0.3required rand ^0.10
env_logger0.11.90.8.4pulled by quickcheck
uuid1.22.01.20.0getrandom 0.4 edition 2024
base64ct1.8.31.7.3edition 2024
psm0.1.300.1.24removed ar_archive_writer (edition 2024)
tera1.20.11.20.0edition 2024

Removed crates

No longer in the dependency tree after the downgrades:

  • rand 0.10, rand_core 0.10, chacha20, cpufeatures — pulled by rand 0.10
  • getrandom 0.4 — edition 2024
  • moxcms, pxfm — pulled by image 0.25.10
  • ar_archive_writer — pulled by psm 0.1.30

Source changes

rand 0.9 renames rand::RngExt back to rand::Rng. All call sites were updated accordingly (no behavioural change).

Consequences

  • The workspace version is bumped to 3.1.0-develop.
  • The workspace MSRV is now 1.83.
  • All dependency versions are frozen in Cargo.lock to editions <= 2021.
  • A future ADR will cover the actual migration to edition = "2024", at which point these pins can be lifted and crates updated to their latest versions.
  • A new MSRV CI job reads rust-version from Cargo.toml and verifies the workspace builds and tests pass on that exact toolchain.