Rustlings: Learning Rust by Fixing Small, Deliberately Broken Programs
Rustlings offers small hands-on exercises that teach you to read and write Rust code, designed to be worked through alongside the official Rust book.
At a glance
- What is it?
- Rustlings is a collection of small exercises that train you to read and write Rust, meant to be used alongside the official Rust book. Its whole point is to get you comfortable with the compiler's feedback by making you fix broken code.
- Who is it for?
- Adopt Rustlings if you are learning Rust and want a hands-on, compiler-driven path that complements the official book. Skip it if you prefer a project-based approach or already know the basics and want to build something real.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 17 days ago.
- What is it written in?
- Mainly Rust, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What Rustlings Actually Teaches You
Rustlings solves a specific problem: the gap between reading Rust syntax and being able to write it fluently. The README describes it as "small exercises to get you used to reading and writing Rust code." That is the entire scope. It is not a tutorial, not a reference, and not a project scaffold. It is a drill set. The intended audience is someone who is already reading the official Rust book, or plans to, and wants to practice in parallel. The exercises force you to interact with the compiler constantly, which is the real teacher here. You are not writing programs from scratch; you are repairing deliberately broken ones. That is a different skill from greenfield coding, but it is exactly the skill you need when you are new to Rust's ownership rules, borrow checker, and type system.
How the Exercises Work: Compiler as Coach
The mechanism is straightforward but effective. Each exercise is a small Rust file with one or more intentional errors. Your job is to run the exercise, read the compiler's error message, fix the code, and run it again until it passes. The README does not detail the exact harness, but the repository layout and the project's purpose make the flow clear: you have a set of numbered exercises, each focusing on a specific Rust concept. The compiler's feedback is the primary guide. This design is smart because Rust's compiler is famously verbose and specific. It tells you exactly what is wrong and often suggests a fix. By working through dozens of these, you learn to interpret those messages quickly, which is a practical skill for real Rust development. The exercises are small, so each one isolates a single concept. That isolation is the core pedagogical trick. You are not debugging a large codebase; you are debugging a single, small, broken function or expression.
Getting Started: Installation and First Run
The README points to the official website for setup instructions, but the repository itself is a Rust project with a standard structure. To use it, you would clone the repository, then follow the instructions on rustlings.rust-lang.org. Typically, that means running `cargo install rustlings` or cloning and running `cargo run` from the project root. The README does not list the exact commands, so you must check the website or the repository's `README` in full. What is clear is that the tool runs from the command line and presents exercises in a sequence. The v6.5.0 release, dated 2025-08-21, suggests an active maintenance cycle. The setup likely requires a recent Rust toolchain, because the exercises target current language features. If you are new to Rust, installing the toolchain is the first hurdle, and that is a separate step. The exercises themselves are not the install problem; they are the practice after the install.
A Real Limitation: It Is Not a Book and Not a Project
The main limitation is that Rustlings is not sufficient on its own. The README explicitly recommends using it "in parallel to reading the official Rust book." That is a honest admission. If you only do the exercises, you will learn to fix small snippets, but you will not learn how to structure a multi-file crate, how to design a public API, or how to handle real-world dependencies. The exercises are deliberately small, so they do not expose you to the complexity of a real codebase. Another limitation is that the exercises are fixed. You cannot easily extend them to cover your own problem areas. The project is a closed set of drills. Once you finish them, you are on your own. For someone who wants a project-based learning path, this is the wrong tool. It is a supplement, not a foundation.
The Alternative: Reading and Writing Your Own Code
The obvious alternative is to skip the exercises and just read the official Rust book and write your own small programs. That approach gives you more freedom, but it also gives you less structure. With Rustlings, you get a curated sequence of concepts, each with a failing test. With self-directed practice, you have to decide what to build and what to learn next. That can be overwhelming for a beginner. Another alternative is to use an interactive platform like the Rust Playground or an online course, but those do not give you the same local, compiler-driven loop. The key difference is that Rustlings is offline, local, and tied to your own compiler. You are not clicking buttons in a browser; you are running `cargo` commands and reading raw compiler output. That is closer to real development than a web-based tutorial. The trade-off is that you get no hand-holding beyond the error messages.
Maintenance and Licensing: What You Should Know
The repository is licensed under MIT, which is permissive and allows you to use, modify, and distribute the exercises freely, as long as you preserve the copyright notice. The last push was on 2025-08-21, and the v6.5.0 release came the same day. The previous release was v6.4.0 in November 2024, and v6.3.0 in August 2024. That shows a steady release cadence, roughly every three to four months. For a learning tool, that means the exercises are likely kept up to date with recent Rust editions and language changes. However, the maintenance cost is on you as a user. You need to update your local clone or installation when new versions come out. The exercises are not a dependency you include in a project; they are a standalone tool. So upgrading is a matter of pulling the latest release and re-running the exercises. The MIT license means you could fork the project and adapt it, but the official version is likely sufficient for most learners.
Who Should Use It and What to Check First
Rustlings is for people who want a structured, hands-on introduction to Rust and are willing to spend time with the compiler. It is especially good for those who learn by doing rather than by reading. The exercises are small, so you can do one in a few minutes and fit them into a busy schedule. The project is not for people who already write Rust at a professional level, because the exercises are too basic. It is also not for people who want to build a portfolio project, because there is nothing to show at the end. Before you start, verify that you have a working Rust toolchain installed, because the exercises will not run without it. Check the website for the current setup instructions, because the README in the repository is minimal. Also, decide whether you are willing to read the book in parallel, because the author recommends it. If you are not, you may find the exercises frustrating without the book's explanations.
Editorial conclusion
Adopt Rustlings if you are learning Rust and want a hands-on, compiler-driven path that complements the official book. Skip it if you prefer a project-based approach or already know the basics and want to build something real. Before starting, verify your Rust toolchain is installed and that you can run the exercises from the command line, because the entire experience depends on the compiler's error messages. The exercises are small by design, so they are not a substitute for reading the book or for writing your own code.
Community notes