From f7f1599f34c65a2346b35fe2b0a475e8694b37ca Mon Sep 17 00:00:00 2001 From: "Celina G. Val" Date: Fri, 14 Nov 2025 14:48:26 -0800 Subject: [PATCH 1/3] Update usage of old stablemir names --- README.md | 2 +- book/src/getting-started.md | 10 +++++----- book/src/initial.md | 2 +- rustc_public/README.md | 39 +++++++++++++++++++------------------ 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 39c6347..2a2165c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ behavior of Rust programs. This is the repository we use to organise and document our work. -If you are wondering how to use Stable MIR in your project, please check out the [Getting Started][tutorial] chapter. +If you are wondering how to use rustc_public in your project, please check out the [Getting Started][tutorial] chapter. [gh-pages]: https://rust-lang.github.io/project-stable-mir diff --git a/book/src/getting-started.md b/book/src/getting-started.md index 5d0750c..26bb896 100644 --- a/book/src/getting-started.md +++ b/book/src/getting-started.md @@ -1,6 +1,6 @@ # Getting Started -The StableMIR APIs are currently exposed as a crate in the compiler named `stable_mir`[^release]. +The StableMIR APIs are currently exposed as a crate in the compiler named `rustc_public`[^release]. This crate includes the definition of structures and methods to be stabilized, which are expected to become the stable APIs in the compiler. @@ -17,13 +17,13 @@ This chapter has two sections directed at different use cases. We also include a [Tips and Tricks](./tricks.md) section that is related to a few common obstacles tool writers encounter, -that is not directly related to the `stable_mir` crate and APIs. +that is not directly related to the `rustc_public` crate and APIs. Our repository also includes a little [demo crate](https://github.com/rust-lang/project-stable-mir/tree/main/demo) that -demonstrate how `stable_mir` crate can be used to analyze the main function of a crate. +demonstrate how `rustc_public` crate can be used to analyze the main function of a crate. The latest crate documentation can be found in the -[nightly documentation here](https://doc.rust-lang.org/nightly/nightly-rustc/stable_mir/index.html) +[nightly documentation here](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_public/index.html) -[^release]: We are planning to release the `stable_mir` crate into crates.io in the near future. +[^release]: We are planning to release the `rustc_public` crate into crates.io in the near future. See issue [#0030](https://github.com/rust-lang/project-stable-mir/issues/30) for the current release status. diff --git a/book/src/initial.md b/book/src/initial.md index 75c210f..145cf11 100644 --- a/book/src/initial.md +++ b/book/src/initial.md @@ -110,4 +110,4 @@ TODO TODO -[`demo/`](https://github.com/rust-lang/project-stable-mir/tree/main/demo) \ No newline at end of file +[`demo/`](https://github.com/rust-lang/project-stable-mir/tree/main/demo) diff --git a/rustc_public/README.md b/rustc_public/README.md index ab2546e..dbe4215 100644 --- a/rustc_public/README.md +++ b/rustc_public/README.md @@ -1,8 +1,8 @@ This crate is currently developed in-tree together with the compiler. -Our goal is to start publishing `stable_mir` into crates.io. +Our goal is to start publishing `rustc_public` into crates.io. 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. +the rustup component `rustc-dev`, and declaring `rustc-public` as an external crate. See the StableMIR ["Getting Started"](https://rust-lang.github.io/project-stable-mir/getting-started.html) guide for more information. @@ -12,34 +12,35 @@ guide for more information. 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. The +- `rustc_public`: Public crate, to be published on crates.io, which will contain +the stable data structure as well as calls to `rustc_public_bridge` 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. +however, this is currently implemented in the `rustc_public_bridge` crate.[^translation]. +- `rustc_public_bridge`: 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, +[^translation]: This is currently implemented in the `rustc_public_bridge` 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`. +tools will depend on `rustc_public` crate, +which will invoke the compiler using APIs defined in `rustc_public_bridge`. I.e.: ``` - ┌──────────────────────────────────┐ ┌──────────────────────────────────┐ - │ External Tool ┌──────────┐ │ │ ┌──────────┐ Rust Compiler │ - │ │ │ │ │ │ │ │ - │ │stable_mir| │ │ │rustc_smir│ │ - │ │ │ ├──────────►| │ │ │ - │ │ │ │◄──────────┤ │ │ │ - │ │ │ │ │ │ │ │ - │ │ │ │ │ │ │ │ - │ └──────────┘ │ │ └──────────┘ │ - └──────────────────────────────────┘ └──────────────────────────────────┘ + ┌────────────────────────────┐ ┌───────────────────────────┐ + │ External Tool │ │ Rust Compiler │ + │ ┌────────────┐ │ │ ┌────────┐ │ + │ │ │ │ │ │ │ │ + │ │rustc_public│ │ │ │rustc │ │ + │ │ │ ├──────────►| │public │ │ + │ │ │ │◄──────────┤ │bridge │ │ + │ │ │ │ │ │ │ │ + │ │ │ │ │ │ │ │ + │ └────────────┘ │ │ └────────┘ │ + └────────────────────────────┘ └───────────────────────────┘ ``` More details can be found here: From 49b9e14842bdccd4b9720d0e332fe6f1f89dd375 Mon Sep 17 00:00:00 2001 From: "Celina G. Val" Date: Fri, 14 Nov 2025 14:59:27 -0800 Subject: [PATCH 2/3] Rename project to "Rustc Librarification" Rename from "Stable MIR" to better reflect the goal of providing SemVer compliant APIs rather than completely stable APIs. --- README.md | 7 +++++-- book/book.toml | 2 +- book/src/getting-started.md | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a2165c..fb35a99 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Stable MIR Librarification Project Group +# Rustc Librarification Project Group (formerly Stable MIR) -Welcome to the repository for the Stable MIR Librarification Project Group! Our goal is to provide a stable +Welcome to the repository for the Rustc Librarification Project Group! Our goal is to provide a SemVer compliant API based on the rust compiler mid-level intermediate representation (MIR) that can be used as the foundation for development of tools that want to perform sophisticated analyses and make stronger guarantees about the behavior of Rust programs. +To avoid confusion, we have renamed our project and our crates to `rustc_public` to better reflect our goal of providing +a public, SemVer compliant interface rather than a completely stable API. + This is the repository we use to organise and document our work. If you are wondering how to use rustc_public in your project, please check out the [Getting Started][tutorial] chapter. diff --git a/book/book.toml b/book/book.toml index 5151850..095ad6b 100644 --- a/book/book.toml +++ b/book/book.toml @@ -1,5 +1,5 @@ [book] -title = "Stable MIR Librarification Project" +title = "Rustc Librarification Project (formerly Stable MIR)" language = "en" [output.html] diff --git a/book/src/getting-started.md b/book/src/getting-started.md index 26bb896..f0a918b 100644 --- a/book/src/getting-started.md +++ b/book/src/getting-started.md @@ -1,8 +1,8 @@ # Getting Started -The StableMIR APIs are currently exposed as a crate in the compiler named `rustc_public`[^release]. -This crate includes the definition of structures and methods to be stabilized, -which are expected to become the stable APIs in the compiler. +The supported APIs are currently exposed as a crate in the compiler named `rustc_public`[^release]. +This crate includes the definition of structures and methods to provide a SemVer compliant interface, +which are expected to become the public APIs in the compiler. These APIs were designed to provide information about a Rust crate, including the body of functions, as well as type and layout information. From a338a69959af8e6139cd9503c87c0d02d8367d04 Mon Sep 17 00:00:00 2001 From: "Celina G. Val" Date: Tue, 18 Nov 2025 12:41:28 -0800 Subject: [PATCH 3/3] Update README.md Update the description to reflect the recent refactoring that moves conversion logic to `rustc_public`. --- rustc_public/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rustc_public/README.md b/rustc_public/README.md index dbe4215..b566de5 100644 --- a/rustc_public/README.md +++ b/rustc_public/README.md @@ -14,15 +14,11 @@ implementation is split between two main crates: - `rustc_public`: Public crate, to be published on crates.io, which will contain the stable data structure as well as calls to `rustc_public_bridge` APIs. The -translation between stable and internal constructs will also be done in this crate, -however, this is currently implemented in the `rustc_public_bridge` crate.[^translation]. +translation between stable and internal constructs is also done in this crate. - `rustc_public_bridge`: 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_public_bridge` crate, -but we are working to change that. - I.e., tools will depend on `rustc_public` crate, which will invoke the compiler using APIs defined in `rustc_public_bridge`.