# Rust 2024 Edition Migration Plan
The workspace is on `edition = "2021"` as of 0.2.31. Migration to
`edition = "2024"` (stabilised in Rust 1.85, our declared MSRV) is
scheduled for the **0.3.0** minor bump — NOT a 0.2.x patch — because
the edition change ships behaviour differences that affect
downstream consumers of the lib.
## Why not now
Edition 2024 changes:
1. **`let` chains in stable** — purely additive, no break.
2. **`gen` keyword reserved** — captchaforge doesn't use `gen` as
an identifier, no break.
3. **Temporary scope changes in `let` patterns** — could affect
`tempfile::tempdir().path()` patterns; need full test pass to
confirm.
4. **`impl Trait` capture changes** — async-trait users (we ship
`#[async_trait]` `CaptchaSolver`) need to verify trait lifetimes
compile under the new rules.
5. **Trait-import disambiguation** — methods now require the
importing trait to be in scope; we have `chromiumoxide::Page`
in scope everywhere it's used, but a sweep is required.
6. **Stricter `unsafe`** in extern blocks — captchaforge is
`#![forbid(unsafe_code)]` everywhere, no effect.
## Migration checklist (when we cut 0.3.0)
1. ```bash
cargo fix --edition --edition-idioms --allow-dirty
```
2. Bump every `Cargo.toml`:
```toml
edition = "2024"
rust-version = "1.85"
```
3. Run the full test matrix:
- `cargo test --workspace`
- `cargo bench --no-run`
- `cargo test -p captchaforge-cli --bin captchaforge`
- `cargo test -p captchaforge-bench --tests`
- `cargo test -p captchaforge-challenge`
- Bindings: `bindings/python/`, `bindings/node/`, `bindings/wasm/`.
4. Verify rustfmt still produces no diff (`cargo fmt --check`).
5. Verify clippy `-D warnings` still clean.
6. Update CHANGELOG with the edition bump under 0.3.0.
## Why the version bump matters
Per `feedback_wafrift_consolidate_crates.md` (memory): minor version
bumps signal "consumer-visible behaviour change", which an edition
migration is even if no API breaks. Downstream consumers running
0.2.x stay on 2021 forever (still supported via 0.2.x backports
for 90 days post-0.3.0 ship).