# How stable is Rust? Will my code still compile next year?
Source: https://ruststudio.org/community/t/8/how-stable-is-rust-will-my-code-still-compile-next-year
Author: Ruststudio Team (staff) | Published: 2026-12-05 | Updated: 2026-12-05 | Checked with: rustc 1.93.0, cargo 1.93.0
Category: Help and questions | Kind: FAQ | Tags: basics, cargo, why-rust | Views: 0

## Short answer
Stable Rust promises that code which compiles on one stable release keeps compiling on later ones, with narrow exceptions such as fixing a soundness bug. Breaking changes are made only in editions, which each crate opts into with the edition key in Cargo.toml, and crates of different editions work together.

## Answer
## Answer
Rust releases a new stable version on a fixed six-week cycle, and the project's compatibility promise is that code written for stable Rust keeps compiling with later stable versions. The exceptions are limited and documented: a fix for a soundness bug, a change to something the documentation never promised, and warnings that become more strict. Code that uses `nightly` features is not covered, because nightly is where unfinished work lives.

Changes that would break existing code are not made in normal releases. They are collected into **editions**, released roughly every three years (2015, 2018, 2021 and 2024 so far). A crate chooses its edition in `Cargo.toml`, and a crate on the 2015 edition still compiles and links with crates on the 2024 edition, so you can upgrade one crate at a time.

```toml title=Cargo.toml
[package]
name = "hello"
version = "0.1.0"
edition = "2024"
```

`cargo new` writes the newest edition for the compiler that you have. With cargo 1.93.0 that was `edition = "2024"`.

## How to do it
1. Update the toolchain.

   ```sh
   rustup update
   ```

2. Build as before. A program that compiled with the previous version should still compile; new warnings may appear.

3. To move a crate to a newer edition, run `cargo fix --edition`, which applies the automatic changes, then change the `edition` line and build and test again.

## Common mistakes
- Pinning an old compiler forever to avoid updates. Updates are designed to be safe, and old compilers do not get security fixes.
- Confusing editions with versions of the compiler. The compiler version is the program you run; the edition is a setting of your crate.
- Depending on a `nightly` feature in a project you need to keep building. Nightly can change at any time.

## Related questions
### Does the Rust standard library change between releases?
New functions and types are added in minor releases; existing stable ones are kept. Each item in the documentation shows the version in which it became stable.

### Do I have to upgrade my edition?
No. An old edition keeps working. Upgrade when you want the language changes it brings.

## Sources
- The Rust Edition Guide: https://doc.rust-lang.org/edition-guide/
- The Cargo Book, "The edition field": https://doc.rust-lang.org/cargo/reference/manifest.html#the-edition-field
