Rust is a systems programming language that reached version 1.0 on May 15, 2015, after nearly a decade of development that began with Graydon Hoare at Mozilla. It offers the speed and low-level control of C and C++ while ruling out whole classes of memory errors at compile time. How Rust prevents memory bugs without garbage collection is the reason it exists, and the reason Linux, Android and Windows teams now use it.

Origins at Mozilla

Hoare started Rust as a personal project in 2006 while working at Mozilla. Mozilla began sponsoring it in 2009 and announced it publicly in 2010. The first compiler was written in OCaml; by 2011 Rust compiled itself using an LLVM back end. Pre-1.0 Rust even had green threads and garbage-collected pointers, both removed before 1.0.

Mozilla's main use case was Servo, an experimental parallel browser engine. Servo's CSS engine, Stylo, shipped in Firefox 57 (Firefox Quantum) in 2017. After Mozilla's 2020 layoffs, the Rust Foundation was formed in February 2021 with AWS, Google, Huawei, Microsoft and Mozilla as founding members.

How Rust prevents memory bugs without garbage collection

Most memory-safe languages use a garbage collector, which adds runtime cost and unpredictable pauses. C and C++ avoid that cost but leave safety to the programmer, and the results are well known: the Microsoft Security Response Center reported in 2019 that around 70% of the security vulnerabilities it fixed were memory-safety issues. Rust takes a third path, checking memory rules in the compiler:

  • Ownership: every value has exactly one owner. When the owner goes out of scope, the value is dropped and its memory freed, much like RAII in C++.
  • Moves: assigning a heap value to another variable transfers ownership, and the old variable can no longer be used, which prevents double frees.
  • Borrowing: you can have many shared references (&T) or one mutable reference (&mut T), never both at once. This rule removes data races.
  • Lifetimes: the compiler proves that references never outlive the data they point to, so dangling pointers do not compile.
  • No null: optional values use Option<T>, and errors use Result<T, E>.
  • Send and Sync traits extend the same checks across threads.

The part of the compiler that enforces these rules is the borrow checker. When low-level work truly needs it, unsafe blocks allow raw pointers, but they are explicit and easy to audit.

A short Rust example

fn longest<'a>(a: &'a str, b: &'a str) -> &'a str {
    if a.len() >= b.len() { a } else { b }
}

fn main() {
    let owner = String::from("ownership");
    let borrowed = &owner;              // shared borrow, nothing is copied
    println!("{}", longest(borrowed, "borrow"));

    let moved = owner;                  // ownership moves to `moved`
    // println!("{}", owner);           // compile error: value used after move
    println!("{moved} has {} bytes", moved.len());
}   // `moved` goes out of scope here and its memory is freed

The lifetime 'a tells the compiler the returned reference lives no longer than both inputs. Uncommenting the marked line causes a compile-time error rather than a runtime crash.

Versions and milestones

YearMilestone
2015Rust 1.0 and the six-week release cycle
2018Rust 2018 edition, non-lexical lifetimes
2019async/await stabilized (Rust 1.39)
2021Rust Foundation formed; Rust 2021 edition
2022Initial Rust support merged in Linux 6.1
2025Rust 2024 edition (Rust 1.85)

Editions let the language evolve without breaking old code: crates from different editions still link together.

Where Rust is used today

  • Operating systems: drivers in the Linux kernel, components of Android, and parts of Windows.
  • Cloud infrastructure: AWS Firecracker (the microVM behind Lambda) and Cloudflare's Pingora proxy.
  • Applications: Firefox, Discord's back-end services, Dropbox's sync engine, and developer tools like ripgrep and Deno.

Rust's tooling is a big part of its appeal: Cargo handles builds and dependencies, crates.io hosts packages, and rustfmt and Clippy keep code consistent. Developers have voted it the most loved or admired language in the Stack Overflow Developer Survey every year since 2016.

Influence

Rust proved that compile-time ownership checking can work in a mainstream language. Swift has added ownership features, Mojo and Move borrow its model, and Carbon's designers cite it.

Should you learn Rust?

Learn Rust if you write performance-critical or security-sensitive code, or if you want to understand memory at a deeper level. Expect a few frustrating weeks with the borrow checker. Once you understand how Rust prevents memory bugs without garbage collection, you will also write safer C, C++ and even Go code.

Frequently asked questions

Does Rust have a garbage collector?

No. Rust frees memory deterministically when an owner goes out of scope, based on rules the compiler checks. Reference-counted types such as Rc and Arc are available in the standard library when shared ownership is needed.

Can Rust code still have memory bugs?

Safe Rust prevents use-after-free, double frees, dangling references and data races. Bugs are still possible inside unsafe blocks or in C libraries called through FFI, and memory leaks are not considered unsafe. Logic errors, of course, still compile.

Why is the Rust borrow checker so hard for beginners?

It forces you to make ownership and lifetimes explicit, which other languages leave implicit or handle at runtime. Patterns that are common in C++ or Java, like shared mutable graphs, need different designs in Rust.