Skip to content

Commit 5cb57e7

Browse files
committed
rrc: Add first mermaid diagram
1 parent 9e35ba7 commit 5cb57e7

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

_posts/2024-09-20-reusing-rustc-components.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ tags:
1111
- trait-solver
1212
---
1313

14+
In order to speed up development, as well as make sure `gccrs` exposes the exact same behavior as `rustc` in critical compiler passes, we have decided
15+
16+
_NOTE: Link to the RFC email_
17+
1418
1. Why
1519
1. To speed up development
1620
2. To make sure we are doing exactly the same thing as rustc in those cases
@@ -31,11 +35,17 @@ tags:
3135
2. We then use gccrs to build them and link to ourselves
3236
7. Bootstrap diagram
3337

38+
![Building gccrs with a borrow-checker](/images/reusing-rustc-components-1.svg)
39+
40+
We can then use `gccrs-stage1` to borrow-check the `polonius` crate, and ensure that it is valid in that regard - otherwise, exit the bootstrapping process.
41+
42+
_NOTE: Explain -DBOOTSTRAPPING_RUST_
43+
_NOTE: Talk about how we can disable some passes like borrow-checking, but for others we'll have to use mocking or our own, less-complete implementation_
44+
3445
```mermaid
3546
flowchart TD;
36-
bootstrapping --> stage1[gccrs-stage1];
37-
bootstrapping --> stage2[gccrs-stage2];
38-
stage1 -- `gccrs-stage1 -frust-disable-borrowck ./polonius` --> polonius[polonius-stage1];
39-
stage2 -- `gccrs-stage2 ./polonius ...` --> valid
40-
polonius -- `.. with polonius-stage1 as a borrow checker` --> valid[polonius-stage2: validated polonius library, ready to ship with gccrs-stage2]
47+
gpp[g++] -- Build gccrs with -DBOOTSTRAP_GCCRS --> stage0[gccrs-stage0.5]
48+
stage0 -- Build polonius-engine crate --> polonius
49+
gpp --> stage1[gccrs-stage1]
50+
polonius -- Link to new build of gccrs --> stage1[gccrs-stage1]
4151
```
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)