mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
split up `rustc_session` Followup on https://github.com/rust-lang/rust/pull/160336 cc @JonathanBrouwer (feel free to review if you want) The first commit splits out the `cstore` module from `rustc_session` into its own crate. `rustc_session` actually never used it anywhere internally, and there are also several crates that only depend on `rustc_session` for it. So it is a natural candidate to split off. The second commit is similar; `rustc_hir::definitions` is moved to `rustc_hir_id`; it is used nowhere in `rustc_hir`, except to implement an inherent method: ```rust impl DefKind { pub fn def_path_data(self, name: Option<Symbol>) -> DefPathData { } } ``` which is used (once) in rustc_middle, so the items in `rustc_hir::definitions` and this conversion function could be in many places. `rustc_hir_id` is the earliest and the easiest, so that's what I went with. Together these allow `rustc_crate_store`, `rustc_hir` and `rustc_session` to compile in parallel. Current graph: <img width="825" height="617" alt="image" src="https://github.com/user-attachments/assets/aa954265-0057-4596-a7c4-38290937fb74" /> Graph after this pr: <img width="853" height="572" alt="image" src="https://github.com/user-attachments/assets/9bcd16f8-897c-4990-920b-249500b2e78e" />