CLI not working with 2024 edition

While working on matching-brackets using the CLI (using VS Code) I get the following error message when running cargo test, or any other cargo command:

error: failed to parse manifest at `/home/raphaeluziel/exercism/rust/matching-brackets/Cargo.toml`

Caused by:
  feature `edition2024` is required

  The package requires the Cargo feature called `edition2024`, but that feature is not stabilized in this version of Cargo (1.83.0 (5ffbef321 2024-10-29)).
  Consider trying a newer version of Cargo (this may require the nightly release).
  See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2024 for more information about the status of this feature.

My solution worked on the Exercism editor even with the edition set to 2024. I know the 2024 edition is supposedly, as of a few days ago, stable, but even doing cargo new is still setting the edition to 2021. I was able to submit the exercise by changing the edition to 2021.

Please update to at least version 1.85 of Rust. If you use rustup try

rustup update stable

Edition 2024 is stable in versions 1.85 and above. We were fast to update the solutions to use it. The web editor version works because it’s being run on a more recent Rust version than your local one. Run rustc --version to see the currently installed version.

2 Likes

Thank you! I was indeed running an older version.

1 Like