WASI notification group GitHub Label: O-wasi Ping command: @rustbot ping wasi This list will be used to ask for help both in diagnosing and testing WASI-related issues as well as suggestions on how to resolve interesting questions regarding...
WebAssembly (WASM) notification group GitHub Label: O-wasm Ping command: @rustbot ping wasm This list will be used to ask for help both in diagnosing and testing WebAssembly-related issues as well as suggestions on how to resolve interestin...
Windows notification group GitHub Label: O-Windows Ping command: @rustbot ping windows This list will be used to ask for help both in diagnosing and testing Windows-related issues as well as suggestions on how to resolve interesting questio...
GPU target notification group Github Label: None Ping command: @rustbot ping gpu-target This notification group deals with linker related issues and their integration within the compiler. The group also has an associated Zulip stream (#t-co...
rust-lang/rust Licenses The rustc compiler source and standard library are dual licensed under the Apache License v2.0 and the MIT License unless otherwise specified. Detailed licensing information is available in the COPYRIGHT document of...
Editions This chapter gives an overview of how Edition support works in rustc. This assumes that you are familiar with what Editions are (see the Edition Guide). Edition definition The --edition CLI flag specifies the edition to use for a c...
Bootstrapping the compiler Bootstrapping is the process of using a compiler to compile itself. More accurately, it means using an older compiler to compile a newer version of the same compiler. This raises a chicken-and-egg paradox: where d...
What Bootstrapping does Bootstrapping is the process of using a compiler to compile itself. More accurately, it means using an older compiler to compile a newer version of the same compiler. This raises a chicken-and-egg paradox: where did...
How Bootstrap does it The core concept in Bootstrap is a build Step, which are chained together by Builder::ensure. Builder::ensure takes a Step as input, and runs the Step if and only if it has not already been run. Let's take a closer loo...
Writing tools in Bootstrap There are three types of tools you can write in bootstrap: • Mode::ToolBootstrap Use this for tools that don’t need anything from the in-tree compiler and can run with the stage0 rustc. The output is placed in the...
Debugging bootstrap There are two main ways of debugging (and profiling bootstrap). The first is through println logging, and the second is through the tracing feature. println logging Bootstrap has extensive unstructured logging. Most of i...
cfg(bootstrap) in compiler dependencies The rust compiler uses some external crates that can run into cyclic dependencies with the compiler itself: the compiler needs an updated crate to build, but the crate needs an updated compiler. This...
High-Level Compiler Architecture The remaining parts of this guide discuss how the compiler works. They go through everything from high-level structure of the compiler to how each stage of compilation works. They should be friendly to both...
Overview of the compiler This chapter is about the overall process of compiling a program -- how everything fits together. The Rust compiler is special in two ways: it does things to your code that other compilers don't do (e.g. borrow-chec...
High-level overview of the compiler source Now that we have seen what the compiler does, let's take a look at the structure of the rust-lang/rust repository, where the rustc source code lives. You may find it helpful to read the "Overview o...
Queries: demand-driven compilation As described in Overview of the compiler, the Rust compiler is still (as of July 2021) transitioning from a traditional "pass-based" setup to a "demand-driven" system. The compiler query system is the key...
The Query Evaluation Model in detail This chapter provides a deeper dive into the abstract model queries are built on. It does not go into implementation details but tries to explain the underlying logic. The examples here, therefore, have...
Incremental compilation The incremental compilation scheme is, in essence, a surprisingly simple extension to the overall query system. We'll start by describing a slightly simplified variant of the real thing – the "basic algorithm" – and...
Incremental compilation in detail The incremental compilation scheme is, in essence, a surprisingly simple extension to the overall query system. It relies on the fact that: 1. queries are pure functions -- given the same inputs, a query wi...
Debugging and testing dependencies Testing the dependency graph There are various ways to write tests against the dependency graph. The simplest mechanisms are the #[rustc_if_this_changed] and #[rustc_then_this_would_need] annotations. Thes...