@@ -18,6 +18,13 @@ rustc, then uses it to compile the new compiler.
18
18
19
19
## Stages of bootstrapping
20
20
21
+ ### Overview
22
+
23
+ - Stage 0: the pre-compiled compiler
24
+ - Stage 1: from current code, by an earlier compiler
25
+ - Stage 2: the truly current compiler
26
+ - Stage 3: the same-result test
27
+
21
28
Compiling ` rustc ` is done in stages. Here's a diagram, adapted from Joshua Nelson's
22
29
[ talk on bootstrapping] [ rustconf22-talk ] at RustConf 2022, with detailed explanations below.
23
30
@@ -47,7 +54,7 @@ graph TD
47
54
classDef with-s1c fill: lightgreen;
48
55
```
49
56
50
- ### Stage 0
57
+ ### Stage 0: the pre-compiled compiler
51
58
52
59
The stage0 compiler is usually the current _ beta_ ` rustc ` compiler
53
60
and its associated dynamic libraries,
@@ -61,11 +68,11 @@ a compiler (with its set of dependencies)
61
68
and its 'target' or 'object' libraries (` std ` and ` rustc ` ).
62
69
Both are staged, but in a staggered manner.
63
70
64
- ### Stage 1
71
+ ### Stage 1: from current code, by an earlier compiler
65
72
66
73
The rustc source code is then compiled with the stage0 compiler to produce the stage1 compiler.
67
74
68
- ### Stage 2
75
+ ### Stage 2: the truly current compiler
69
76
70
77
We then rebuild our stage1 compiler with itself to produce the stage2 compiler.
71
78
@@ -88,7 +95,7 @@ For development, you usually only want the `stage1` compiler,
88
95
which you can build with ` ./x.py build library ` .
89
96
See [ Building the Compiler] ( ./how-to-build-and-run.html#building-the-compiler ) .
90
97
91
- ### Stage 3
98
+ ### Stage 3: the same-result test
92
99
93
100
Stage 3 is optional. To sanity check our new compiler, we
94
101
can build the libraries with the stage2 compiler. The result ought
0 commit comments