Skip to content

cargo-chef prepare injects per-target edition causing deprecation warnings with edition 2024 #350

@pythoninthegrass

Description

@pythoninthegrass

Description

When using cargo chef prepare on a project with edition = "2024" in [package], the generated recipe injects edition = "2024" onto each individual target ([[bin]], [lib], [[example]]). This triggers deprecation warnings from Cargo nightly:

warning: /build/crates/mt-tauri/Cargo.toml: `edition` is set on library `mt_lib` which is deprecated
warning: /build/crates/mt-tauri/Cargo.toml: `edition` is set on binary `mt` which is deprecated
warning: /build/crates/mt-tauri/Cargo.toml: `edition` is set on example `audio_test` which is deprecated

Reproduction

Cargo.toml:

[package]
name = "my-crate"
edition = "2024"

[[bin]]
name = "my-bin"
path = "src/main.rs"

[lib]
name = "my_lib"

Run cargo chef prepare --recipe-path recipe.json and inspect the generated manifest — each target gets an explicit edition = "2024" field.

Expected behavior

cargo-chef should not propagate the package-level edition to individual targets, since Cargo 2024 edition inherits it automatically from [package].

Environment

  • cargo-chef: 0.1.77
  • Rust: nightly-2026-02-09
  • edition: 2024

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions