Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Clarify that the translation between unstable and stable items is currently done in the `rustc_smir` crate.
  • Loading branch information
celinval authored Oct 24, 2024
1 parent f1114ba commit aa2f968
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions compiler/stable_mir/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
This crate is currently developed in-tree together with the compiler.

Our goal is to start publishing `stable_mir` into crates.io.
Until then, users will use this as any other rustc crate, via extern crate.
Until then, users will use this as any other rustc crate, by installing
the rustup component `rustc-dev`, and declaring `stable-mir` as an external crate.

See the StableMIR ["Getting Started"](https://rust-lang.github.io/project-stable-mir/getting-started.html)
guide for more information.

## Stable MIR Design

The stable-mir will follow a similar approach to proc-macro2. Its
implementation is split between two main crates:

- `stable_mir`: Public crate, to be published on crates.io, which will contain
the stable data structure as well as calls to `rustc_smir` APIs and
translation between stable and internal constructs.
the stable data structure as well as calls to `rustc_smir` APIs. The
translation between stable and internal constructs will also be done in this crate,
however, this is currently implemented in the `rustc_smir` crate.[^translation].
- `rustc_smir`: This crate implements the public APIs to the compiler.
It is responsible for gathering all the information requested, and providing
the data in its unstable form.

[^translation]: This is currently implemented in the `rustc_smir` crate,
but we are working to change that.

I.e.,
tools will depend on `stable_mir` crate,
which will invoke the compiler using APIs defined in `rustc_smir`.
Expand Down

0 comments on commit aa2f968

Please sign in to comment.