rust-lang / rust
Empowering everyone to build reliable and efficient software.
The Rust repository separates the compiler from the standard library at the top level, which mirrors how the project is actually built: the compiler is bootstrapped in stages, and each stage compiles the library. Tests are split by kind rather than by module, because the compiler needs test suites that assert on its own diagnostics.
- Compiler and standard library kept as separate top-level trees.
- Tests grouped by kind rather than by the module under test.
- A bootstrap directory dedicated to the multi-stage build process.
Notable Directories
/compilerThe rustc compiler, split into crates by phase such as parsing, type checking, and code generation.
/libraryThe standard library: core, alloc, and std, layered by what each can depend on.
/testsSuites organised by kind, including UI tests that assert on exact compiler output.
/src/bootstrapThe staged build system that compiles the compiler with itself.
Build Your Own Ecosystem
Learn from rust's structure and craft your own software scaffolding.