feature edition2024 is required / Cargo.lock version too new Rust Origin: Application & API OSI layer 7 · Application Last updated 5 Nov 2026

Cargo: error: failed to parse manifest — feature `edition2024` is required / lock file version 4 requires `-Znext-lockfile-bump`

Your Cargo is older than the manifest or lockfile requires.

Exact message you may see error: failed to parse manifest at Cargo.tomlfeature `edition2024` is requiredlock file version 4 requires `-Znext-lockfile-bump`this version of Cargo is older than the `2024` editionerror: failed to parse lock file at Cargo.lock
Seen on: Rust

Meaning

Update Rust (rustup update stable), or downgrade the offending crate/lock (cargo update -p crate --precise X) when you must stay on an old toolchain. Lockfile v4 needs Cargo 1.78+; edition = "2024" needs 1.85+. Pin the toolchain in rust-toolchain.toml for consistency across team/CI.

Common causes

  • Old Rust toolchain
  • Cargo.lock generated by newer Cargo
  • Dependency using edition = "2024"
  • CI image pinned to an old Rust
  • Different toolchains between dev and CI

⚡ Quick fix

  1. rustup update stable
  2. Add rust-toolchain.toml (channel = "stable")
  3. Pin crates to older versions with cargo update -p X --precise Y if you can't upgrade

Detailed fix by platform

Rust

  1. rustup update stable && cargo --version

How to diagnose

  1. Cargo — Version?
  2. Lock — Version?
  3. CI — Same toolchain?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

Blocking waiting for file lock on package cache / build directory — Cargo: Blocking waiting for file lock on package cache / on build directory (Rust)Blocking waiting for …cargo: failed to get from registry (spurious network error) — Cargo: warning: spurious network error (2 tries remaining): [35] SSL connect error / error: failed to download from `https://index.crates.io/...` (Rust)cargo: failed to get …cargo: failed to select a version for the requirement — Cargo: error: failed to select a version for the requirement `serde = "^2.0"` — candidate versions found which didn't match: 1.0.197 (Rust)cargo: failed to sele…E0004: non-exhaustive patterns — Rust: error[E0004]: non-exhaustive patterns: `None` not covered (Rust)E0004: non-exhaustive…E0015: cannot call non-const function in constants — Rust: error[E0015]: cannot call non-const function `String::from` in constants (Rust)E0015: cannot call no…E0061: this function takes N arguments but M were supplied — Rust: error[E0061]: this function takes 2 arguments but 1 argument was supplied (Rust)E0061: this function …E0063: missing field in initializer of struct — Rust: error[E0063]: missing field `age` in initializer of `User` (Rust)E0063: missing field …E0133: call to unsafe function requires unsafe block — Rust: error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block (Rust)E0133: call to unsafe…feature e…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.