Error: failed to parse manifest at `/playground/Cargo.toml`

fn main() {
    println!("Hello, world!");
}

(Playground)

Errors:

error: failed to parse manifest at `/playground/Cargo.toml`

Caused by:
  the cargo feature `edition2024` requires a nightly version of Cargo, but this is the `stable` channel
  See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
  See https://doc.rust-lang.org/cargo/reference/unstable.html#edition-2024 for more information about using this feature.

It's the year 2024, but Rust's edition "2024" is not released yet. The nightly compiler does however already offer this edition so that developers and testers of the Rust compiler can make sure that those parts of edition 2024 that already do exist for pre-view do work as intended.

As far as I can tell, the current schedule has edition 2024 arrive in October: Rust 2024 🚧 - The Rust Edition Guide

Also here is a page that tracks progress of individual things that should become part of edition 2024: Lang Edition 2024 · GitHub

The rust playground seems to support edition 2024 since November last year: Support Rust edition 2024 by shepmaster · Pull Request #994 · rust-lang/rust-playground · GitHub <- this sounds like the playground has some partial measures added so one more easily uses the options correctly and only tries 2024 edition with a nightly version of Rust enabled.

Anyways, you might not be interested in all of this context anyways...

TL;DR The error message is expected. Edition 2024 is not out yet and will come later in the year. You can preview its current state by using Nightly Rust instead of Stable (or Beta). If you want to use the actual latest (existing / finished / stable) edition, the correct choice today is still edition 2021.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.