LukeMathWalker / LukeMathWalker/cargo-chef
cargo-chef prepare injects per-target `edition` causing deprecation warnings with edition 2024
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
## 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`:
```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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the manifest generation used by `cargo chef prepare` and reproduce the issue with the provided `Cargo.toml` and `--recipe-path recipe.json`. Confirm that generated `[[bin]]`, `[lib]`, and `[[example]]` entries no longer contain propagated `edition` fields, and that the Cargo deprecation warnings are gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100