about summary refs log tree commit diff
path: root/compiler/rustc_public_bridge/src/lib.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-07-22 00:54:27 +0800
committerGitHub <noreply@github.com>2025-07-22 00:54:27 +0800
commit2e0748b1858079062284e116d0730a8156a1dab7 (patch)
treef2b876b2b5cfe346eb7a73f9ded4e8d92edefb4a /compiler/rustc_public_bridge/src/lib.rs
parent38efe3875aac14e282e64623e241acdf973d0f63 (diff)
parent20a7f722d824ebc4e733ec848d797088363624e9 (diff)
downloadrust-2e0748b1858079062284e116d0730a8156a1dab7.tar.gz
rust-2e0748b1858079062284e116d0730a8156a1dab7.zip
Rollup merge of #143985 - makai410:rp-rename, r=oli-obk
rustc_public: de-StableMIR-ize

This PR updates relevant docs about StableMIR, basically just rewording StableMIR/SMIR to rustc_public/rustc_public's IR.

The README.md in the `rustc_public` crate is out-dated. I plan to rewrite it after we fork rustc_public into its own repository.

This PR doesn't change the fact that we still use `-Z unpretty=stable-mir` as a rustc parameter for printing the IR, since I feel it's a bit verbose and weird if we use `-Z unpretty=rustc-public-ir`. I was wondering if we can have a short and easy alias for rustc_public's IR.
Diffstat (limited to 'compiler/rustc_public_bridge/src/lib.rs')
-rw-r--r--compiler/rustc_public_bridge/src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_public_bridge/src/lib.rs b/compiler/rustc_public_bridge/src/lib.rs
index 652a8093a87..dec3be70baf 100644
--- a/compiler/rustc_public_bridge/src/lib.rs
+++ b/compiler/rustc_public_bridge/src/lib.rs
@@ -1,6 +1,6 @@
-//! Crate that implements what will become the rustc side of Stable MIR.
+//! Crate that implements what will become the rustc side of rustc_public.
 //!
-//! This crate is responsible for building Stable MIR components from internal components.
+//! This crate serves as a proxy for making calls to rustc queries.
 //!
 //! This crate is not intended to be invoked directly by users.
 //! This crate is the public API of rustc that will be invoked by the `rustc_public` crate.
@@ -29,7 +29,7 @@ use std::hash::Hash;
 use std::ops::Index;
 
 use bridge::*;
-use context::SmirCtxt;
+use context::CompilerCtxt;
 use rustc_data_structures::fx::{self, FxIndexMap};
 use rustc_middle::mir;
 use rustc_middle::mir::interpret::AllocId;
@@ -46,9 +46,9 @@ pub mod context;
 pub mod rustc_internal {}
 
 /// A container which is used for TLS.
-pub struct SmirContainer<'tcx, B: Bridge> {
+pub struct Container<'tcx, B: Bridge> {
     pub tables: RefCell<Tables<'tcx, B>>,
-    pub cx: RefCell<SmirCtxt<'tcx, B>>,
+    pub cx: RefCell<CompilerCtxt<'tcx, B>>,
 }
 
 pub struct Tables<'tcx, B: Bridge> {
@@ -210,7 +210,7 @@ impl<'tcx, B: Bridge> Tables<'tcx, B> {
     }
 }
 
-/// A trait defining types that are used to emulate StableMIR components, which is really
+/// A trait defining types that are used to emulate rustc_public components, which is really
 /// useful when programming in rustc_public-agnostic settings.
 pub trait Bridge: Sized {
     type DefId: Copy + Debug + PartialEq + IndexedVal;
@@ -222,7 +222,7 @@ pub trait Bridge: Sized {
     type MirConstId: Copy + Debug + PartialEq + IndexedVal;
     type Layout: Copy + Debug + PartialEq + IndexedVal;
 
-    type Error: SmirError;
+    type Error: Error;
     type CrateItem: CrateItem<Self>;
     type AdtDef: AdtDef<Self>;
     type ForeignModuleDef: ForeignModuleDef<Self>;