rust-lang/cargo · error · anyhow::Error
`[project]` is not supported as of the 2024 Edition, please
Error message
`[project]` is not supported as of the 2024 Edition, please use `[package]`
What it means
Thrown at src/workspace/parser/mod.rs:1395. Historically cargo accepted `[project]` as a synonym for `[package]`; in edition 2024 and later the `[project]` table is rejected entirely and `[package]` is required (`original_toml.project.is_some() && Edition::Edition2024 <= edition`). Earlier editions only warn.
Source
Thrown at src/workspace/parser/mod.rs:1395
));
}
default_edition
};
if !edition.is_stable() {
let version = normalized_package
.normalized_version()
.expect("previously normalized")
.map(|v| format!("@{v}"))
.unwrap_or_default();
let hint = rust_version
.as_ref()
.map(|rv| format!("help: {package_name}{version} requires rust {rv}"));
features.require_with_hint(Feature::unstable_editions(), hint.as_deref())?;
}
if original_toml.project.is_some() {
if Edition::Edition2024 <= edition {
anyhow::bail!(
"`[project]` is not supported as of the 2024 Edition, please use `[package]`"
);
} else {
warnings.push(format!("`[project]` is deprecated in favor of `[package]`"));
}
}
if normalized_package.metabuild.is_some() {
features.require(Feature::metabuild())?;
}
if is_embedded {
let manifest::TomlManifest {
cargo_features: _,
package: _,
project: _,
badges: _,
features: _,View on GitHub (pinned to 0e07a15537)
Solutions
- Rename the section header from `[project]` to `[package]`.
- After renaming, run `cargo check` to confirm no other deprecated keys remain.
Example fix
# before (edition 2024) [project] name = "mycrate" version = "0.1.0" # after [package] name = "mycrate" version = "0.1.0"
Defensive patterns
Strategy: validation
Validate before calling
if edition >= 2024 && doc.as_table().get("project").and_then(|i| i.as_table_like()).is_some() {
return Err("rename [project] to [package] for edition 2024".into());
} Prevention
- Always use `[package]`, never `[project]`.
- Run an edition upgrade linter that renames legacy headers.
When it happens
Trigger: A Cargo.toml on edition 2024 that still uses a `[project]` header instead of `[package]`.
Common situations: Upgrading an old crate to edition 2024; manifests generated by ancient `cargo new` versions or templates.
Related errors
- `{old_path}` is unsupported as of the 2024 edition; instead
- Deprecated dependency sections are unsupported: {}
- `default-features = false` cannot override workspace's `defa
- dependency `{}` in package `{}` requires a `{}` artifact to
- multiple packages link to native library `{}`, but a native
AI-assisted analysis of rust-lang/cargo@0e07a15537 (2026-08-06).
Data as JSON: /data/errors/7ecf1711521411b5.json.
Report an issue: GitHub.