# Where Are Rustlings Exercise Solutions Stored?

> Discover where Rustlings exercise solutions are stored. Find reference implementations for quizzes within the rust-lang/rustlings repository.

- Repository: [The Rust Programming Language/rustlings](https://github.com/rust-lang/rustlings)
- Tags: how-to-guide
- Published: 2026-03-05

---

**TLDR:** Rustlings intentionally omits solutions for most exercises, storing reference implementations solely for quiz exercises in the `solutions/quizzes/` directory at the repository root.

The `rust-lang/rustlings` repository is designed as an interactive Rust learning tool where you compile and fix broken code to progress through concepts. Unlike many tutorial projects that include comprehensive answer keys, Rustlings follows a deliberate pedagogy where you write the solutions yourself. Understanding where Rustlings exercise solutions are stored—and why most are missing—helps you navigate the project structure effectively and align with the intended learning workflow.

## Official Solution Locations in the Repository

While the majority of Rustlings exercises require you to write code from scratch, the project does include a small set of reference implementations for assessment checkpoints.

### Quiz Solutions in solutions/quizzes/

The only official solutions provided are for the **quiz exercises**, which serve as progress checkpoints throughout the curriculum. These are located in the `solutions/quizzes/` directory at the root of the repository:

- [`solutions/quizzes/quiz1.rs`](https://github.com/rust-lang/rustlings/blob/main/solutions/quizzes/quiz1.rs) – Reference implementation for the first quiz
- [`solutions/quizzes/quiz2.rs`](https://github.com/rust-lang/rustlings/blob/main/solutions/quizzes/quiz2.rs) – Reference implementation for the second quiz
- [`solutions/quizzes/quiz3.rs`](https://github.com/rust-lang/rustlings/blob/main/solutions/quizzes/quiz3.rs) – Reference implementation for the third quiz

Each file contains fully implemented Rust code that demonstrates one possible correct solution to the quiz challenge.

### Documentation in solutions/README.md

The [`solutions/README.md`](https://github.com/rust-lang/rustlings/blob/main/solutions/README.md) file explains the philosophy behind the missing solutions and provides guidance on how to use the quiz solutions as learning references rather than shortcuts. This documentation clarifies why the repository deliberately omits solutions for the core learning exercises.

## The Exercises Directory: Where You Write the Code

The `exercises/` directory at the repository root contains all the starter files you edit during your learning journey. According to the source code structure in `rust-lang/rustlings`, these files contain only skeleton code or intentionally failing implementations. **No hidden solution files exist** alongside the exercises—you are expected to modify these `.rs` files directly until they compile and pass the tests.

## How to Access the Available Solutions

You can view the quiz solutions using several methods depending on your workflow.

### Display solutions in the terminal

```bash

# View the solution for quiz 2

cat solutions/quizzes/quiz2.rs

```

### Open solutions in a web browser

Navigate directly to the files in the GitHub repository:

- Quiz 1: https://github.com/rust-lang/rustlings/blob/main/solutions/quizzes/quiz1.rs
- Quiz 2: https://github.com/rust-lang/rustlings/blob/main/solutions/quizzes/quiz2.rs
- Quiz 3: https://github.com/rust-lang/rustlings/blob/main/solutions/quizzes/quiz3.rs

### Read solutions programmatically

```rust
use std::fs;

fn main() -> std::io::Result<()> {
    // Load the solution for quiz 1
    let solution = fs::read_to_string("solutions/quizzes/quiz1.rs")?;
    println!("Quiz 1 solution:\n{}", solution);
    Ok(())
}

```

## Summary

- **Quiz solutions only**: Rustlings provides reference implementations exclusively for quiz exercises in `solutions/quizzes/`.
- **No core exercise solutions**: The `exercises/` directory contains only starter code without answer keys.
- **Pedagogical intent**: The absence of solutions for most exercises forces active learning through implementation rather than copying.
- **Three quiz files**: [`quiz1.rs`](https://github.com/rust-lang/rustlings/blob/main/quiz1.rs), [`quiz2.rs`](https://github.com/rust-lang/rustlings/blob/main/quiz2.rs), and [`quiz3.rs`](https://github.com/rust-lang/rustlings/blob/main/quiz3.rs) serve as the only official solution references in the repository.
- **Documentation**: [`solutions/README.md`](https://github.com/rust-lang/rustlings/blob/main/solutions/README.md) explains the project philosophy regarding the intentional lack of solutions.

## Frequently Asked Questions

### Does Rustlings provide solutions for all exercises?

No. The repository intentionally omits solutions for the core exercises to ensure you practice writing Rust code yourself. Only the three quiz exercises include official reference implementations in the `solutions/quizzes/` directory, as implemented in `rust-lang/rustlings`.

### Can I find hidden solution files in the exercises directory?

No. The `exercises/` directory contains only the starter files you are meant to edit. According to the repository structure, there are no hidden solution files or answer keys stored alongside the exercise skeletons.

### How should I use the quiz solutions?

Treat the quiz solutions in `solutions/quizzes/` as reference material to review after attempting the quizzes yourself. The [`solutions/README.md`](https://github.com/rust-lang/rustlings/blob/main/solutions/README.md) file specifically advises against looking at these files before making your own attempt, as this undermines the learning process.

### What if I get stuck on an exercise without a solution?

Since no official solutions exist for most exercises, you should use the Rust compiler's error messages, consult the Rust Book, or leverage community resources like the Rust Discord or Stack Overflow. The Rustlings CLI tool provides hints via the `hint` command to guide you without revealing complete answers.