Update compiler-src.md

Refactor the dependency structure from a nested unordered list to a single-level ordered list.

IMO, this is clearer, but happy to close this PR without merging, if the change is not desired.
This commit is contained in:
Stan Manilov 2025-04-29 16:39:54 +03:00 committed by GitHub
parent b5367b8f95
commit 7700fb5dc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 13 deletions

View File

@ -62,21 +62,20 @@ huge. There is also the `rustc` crate which is the actual binary (i.e. the
[`rustc_driver`] crate, which drives the various parts of compilation in other [`rustc_driver`] crate, which drives the various parts of compilation in other
crates. crates.
The dependency structure of these crates is complex, but roughly it is The dependency order of these crates is complex, but roughly it is
something like this: something like this:
- `rustc` (the binary) calls [`rustc_driver::main`][main]. 1. `rustc` (the binary) calls [`rustc_driver::main`][main].
- [`rustc_driver`] depends on a lot of other crates, but the main one is 1. [`rustc_driver`] depends on a lot of other crates, but the main one is
[`rustc_interface`]. [`rustc_interface`].
- [`rustc_interface`] depends on most of the other compiler crates. It 1. [`rustc_interface`] depends on most of the other compiler crates. It is a
is a fairly generic interface for driving the whole compilation. fairly generic interface for driving the whole compilation.
- Most of the other `rustc_*` crates depend on [`rustc_middle`], 1. Most of the other `rustc_*` crates depend on [`rustc_middle`], which defines
which defines a lot of central data structures in the compiler. a lot of central data structures in the compiler.
- [`rustc_middle`] and most of the other crates depend on a 1. [`rustc_middle`] and most of the other crates depend on a handful of crates
handful of crates representing the early parts of the representing the early parts of the compiler (e.g. the parser), fundamental
compiler (e.g. the parser), fundamental data structures (e.g. data structures (e.g. [`Span`]), or error reporting:
[`Span`]), or error reporting: [`rustc_data_structures`], [`rustc_data_structures`], [`rustc_span`], [`rustc_errors`], etc.
[`rustc_span`], [`rustc_errors`], etc.
[`rustc_data_structures`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/index.html [`rustc_data_structures`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/index.html
[`rustc_driver`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/index.html [`rustc_driver`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/index.html