diff options
| author | Makai <m4kai410@gmail.com> | 2025-07-15 16:22:33 +0000 |
|---|---|---|
| committer | Makai <m4kai410@gmail.com> | 2025-07-18 18:49:12 +0000 |
| commit | 483877a9b2140065df08e15a27c20c9431028ec5 (patch) | |
| tree | 7e65c552baac2c4280b4df8245fe2d9797fee202 /compiler/rustc_public | |
| parent | 95338717f10b46dfac7ee8333672ede004ca212b (diff) | |
| download | rust-483877a9b2140065df08e15a27c20c9431028ec5.tar.gz rust-483877a9b2140065df08e15a27c20c9431028ec5.zip | |
Update docs in `rustc_public`
Diffstat (limited to 'compiler/rustc_public')
| -rw-r--r-- | compiler/rustc_public/src/alloc.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/compiler_interface.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_public/src/error.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/mir/alloc.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/mir/body.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_public/src/mir/mono.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_public/src/mir/pretty.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/mir/visit.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/rustc_internal/mod.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_public/src/rustc_internal/pretty.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/unstable/convert/internal.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/unstable/convert/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/unstable/mod.rs | 19 |
13 files changed, 31 insertions, 30 deletions
diff --git a/compiler/rustc_public/src/alloc.rs b/compiler/rustc_public/src/alloc.rs index dcb3cc0e75f..75ad31022ff 100644 --- a/compiler/rustc_public/src/alloc.rs +++ b/compiler/rustc_public/src/alloc.rs @@ -1,4 +1,4 @@ -//! Memory allocation implementation for StableMIR. +//! Memory allocation implementation for rustc_public. //! //! This module is responsible for constructing stable components. //! All operations requiring rustc queries must be delegated diff --git a/compiler/rustc_public/src/compiler_interface.rs b/compiler/rustc_public/src/compiler_interface.rs index 043064951d5..5a09c3b24f0 100644 --- a/compiler/rustc_public/src/compiler_interface.rs +++ b/compiler/rustc_public/src/compiler_interface.rs @@ -1,6 +1,6 @@ //! Define the interface with the Rust compiler. //! -//! StableMIR users should not use any of the items in this module directly. +//! rustc_public users should not use any of the items in this module directly. //! These APIs have no stability guarantee. use std::cell::Cell; @@ -1067,7 +1067,7 @@ where F: FnOnce() -> T, { if TLV.is_set() { - Err(Error::from("StableMIR already running")) + Err(Error::from("rustc_public already running")) } else { let ptr: *const () = (&raw const interface) as _; TLV.set(&Cell::new(ptr), || Ok(f())) diff --git a/compiler/rustc_public/src/error.rs b/compiler/rustc_public/src/error.rs index 70a74eaa9fb..3d75a4bd315 100644 --- a/compiler/rustc_public/src/error.rs +++ b/compiler/rustc_public/src/error.rs @@ -1,5 +1,5 @@ //! When things go wrong, we need some error handling. -//! There are a few different types of errors in StableMIR: +//! There are a few different types of errors in rustc_public: //! //! - [CompilerError]: This represents errors that can be raised when invoking the compiler. //! - [Error]: Generic error that represents the reason why a request that could not be fulfilled. diff --git a/compiler/rustc_public/src/mir/alloc.rs b/compiler/rustc_public/src/mir/alloc.rs index 9a94551f3ec..07a979f3811 100644 --- a/compiler/rustc_public/src/mir/alloc.rs +++ b/compiler/rustc_public/src/mir/alloc.rs @@ -9,7 +9,7 @@ use crate::target::{Endian, MachineInfo}; use crate::ty::{Allocation, Binder, ExistentialTraitRef, Ty}; use crate::{Error, IndexedVal, with}; -/// An allocation in the SMIR global memory can be either a function pointer, +/// An allocation in the rustc_public's IR global memory can be either a function pointer, /// a static, or a "real" allocation with some data in it. #[derive(Debug, Clone, Eq, PartialEq, Serialize)] pub enum GlobalAlloc { diff --git a/compiler/rustc_public/src/mir/body.rs b/compiler/rustc_public/src/mir/body.rs index 28a7aa6e758..3320b98cd61 100644 --- a/compiler/rustc_public/src/mir/body.rs +++ b/compiler/rustc_public/src/mir/body.rs @@ -10,7 +10,7 @@ use crate::ty::{ }; use crate::{Error, Opaque, Span, Symbol}; -/// The SMIR representation of a single function. +/// The rustc_public's IR representation of a single function. #[derive(Clone, Debug, Serialize)] pub struct Body { pub blocks: Vec<BasicBlock>, @@ -771,8 +771,8 @@ pub enum VarDebugInfoContents { // In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This // is so it can be used for both Places (for which the projection elements are of type // ProjectionElem<Local, Ty>) and user-provided type annotations (for which the projection elements -// are of type ProjectionElem<(), ()>). In SMIR we don't need this generality, so we just use -// ProjectionElem for Places. +// are of type ProjectionElem<(), ()>). +// In rustc_public's IR we don't need this generality, so we just use ProjectionElem for Places. #[derive(Clone, Debug, Eq, PartialEq, Serialize)] pub enum ProjectionElem { /// Dereference projections (e.g. `*_1`) project to the address referenced by the base place. diff --git a/compiler/rustc_public/src/mir/mono.rs b/compiler/rustc_public/src/mir/mono.rs index 06f6ac17e7b..d488f5a25c7 100644 --- a/compiler/rustc_public/src/mir/mono.rs +++ b/compiler/rustc_public/src/mir/mono.rs @@ -62,7 +62,7 @@ impl Instance { /// For more information on fallback body, see <https://github.com/rust-lang/rust/issues/93145>. /// /// This call is much cheaper than `instance.body().is_some()`, since it doesn't try to build - /// the StableMIR body. + /// the rustc_public's IR body. pub fn has_body(&self) -> bool { with(|cx| cx.has_body(self.def.def_id())) } @@ -157,7 +157,7 @@ impl Instance { /// /// Allow users to check if this shim can be ignored when called directly. /// - /// We have decided not to export different types of Shims to StableMIR users, however, this + /// We have decided not to export different types of Shims to rustc_public users, however, this /// is a query that can be very helpful for users when processing DropGlue. /// /// When generating code for a Drop terminator, users can ignore an empty drop glue. diff --git a/compiler/rustc_public/src/mir/pretty.rs b/compiler/rustc_public/src/mir/pretty.rs index f496d80053e..a433df2dba1 100644 --- a/compiler/rustc_public/src/mir/pretty.rs +++ b/compiler/rustc_public/src/mir/pretty.rs @@ -1,4 +1,4 @@ -//! Implement methods to pretty print stable MIR body. +//! Implement methods to pretty print rustc_public's IR body. use std::fmt::Debug; use std::io::Write; use std::{fmt, io, iter}; diff --git a/compiler/rustc_public/src/mir/visit.rs b/compiler/rustc_public/src/mir/visit.rs index 7dc99d1d1e1..04c4d4d2a82 100644 --- a/compiler/rustc_public/src/mir/visit.rs +++ b/compiler/rustc_public/src/mir/visit.rs @@ -1,4 +1,4 @@ -//! # The Stable MIR Visitor +//! # The rustc_public's IR Visitor //! //! ## Overview //! diff --git a/compiler/rustc_public/src/rustc_internal/mod.rs b/compiler/rustc_public/src/rustc_internal/mod.rs index ca999b62f80..a119958974e 100644 --- a/compiler/rustc_public/src/rustc_internal/mod.rs +++ b/compiler/rustc_public/src/rustc_internal/mod.rs @@ -1,7 +1,7 @@ -//! Module that implements the bridge between Stable MIR and internal compiler MIR. +//! Module that implements the bridge between rustc_public's IR and internal compiler MIR. //! //! For that, we define APIs that will temporarily be public to 3P that exposes rustc internal APIs -//! until stable MIR is complete. +//! until rustc_public's IR is complete. use std::cell::{Cell, RefCell}; @@ -26,7 +26,7 @@ pub mod pretty; /// /// # Panics /// -/// This function will panic if StableMIR has not been properly initialized. +/// This function will panic if rustc_public has not been properly initialized. pub fn stable<'tcx, S: Stable<'tcx>>(item: S) -> S::T { with_container(|tables, cx| item.stable(tables, cx)) } @@ -41,7 +41,7 @@ pub fn stable<'tcx, S: Stable<'tcx>>(item: S) -> S::T { /// /// # Panics /// -/// This function will panic if StableMIR has not been properly initialized. +/// This function will panic if rustc_public has not been properly initialized. pub fn internal<'tcx, S>(tcx: TyCtxt<'tcx>, item: S) -> S::T<'tcx> where S: RustcInternal, @@ -57,7 +57,7 @@ pub fn crate_num(item: &crate::Crate) -> CrateNum { } // A thread local variable that stores a pointer to the tables mapping between TyCtxt -// datastructures and stable MIR datastructures +// datastructures and rustc_public's IR datastructures scoped_thread_local! (static TLV: Cell<*const ()>); pub(crate) fn init<'tcx, F, T, B: Bridge>(container: &Container<'tcx, B>, f: F) -> T @@ -176,7 +176,7 @@ macro_rules! optional { /// Prefer using [run!] and [run_with_tcx] instead. /// -/// This macro implements the instantiation of a StableMIR driver, and it will invoke +/// This macro implements the instantiation of a rustc_public driver, and it will invoke /// the given callback after the compiler analyses. /// /// The third argument determines whether the callback requires `tcx` as an argument. diff --git a/compiler/rustc_public/src/rustc_internal/pretty.rs b/compiler/rustc_public/src/rustc_internal/pretty.rs index 28c5280fe04..83522e51977 100644 --- a/compiler/rustc_public/src/rustc_internal/pretty.rs +++ b/compiler/rustc_public/src/rustc_internal/pretty.rs @@ -7,7 +7,7 @@ use super::run; pub fn write_smir_pretty<'tcx, W: io::Write>(tcx: TyCtxt<'tcx>, w: &mut W) -> io::Result<()> { writeln!( w, - "// WARNING: This is highly experimental output it's intended for stable-mir developers only." + "// WARNING: This is highly experimental output it's intended for rustc_public developers only." )?; writeln!( w, diff --git a/compiler/rustc_public/src/unstable/convert/internal.rs b/compiler/rustc_public/src/unstable/convert/internal.rs index 0571a03b62b..b2d38e497bc 100644 --- a/compiler/rustc_public/src/unstable/convert/internal.rs +++ b/compiler/rustc_public/src/unstable/convert/internal.rs @@ -1,4 +1,4 @@ -//! Module containing the translation from stable mir constructs to the rustc counterpart. +//! Module containing the translation from rustc_public constructs to the rustc counterpart. //! //! This module will only include a few constructs to allow users to invoke internal rustc APIs //! due to incomplete stable coverage. diff --git a/compiler/rustc_public/src/unstable/convert/mod.rs b/compiler/rustc_public/src/unstable/convert/mod.rs index a2e83c6e239..f20406631e3 100644 --- a/compiler/rustc_public/src/unstable/convert/mod.rs +++ b/compiler/rustc_public/src/unstable/convert/mod.rs @@ -1,4 +1,4 @@ -//! This module holds the logic to convert rustc internal ADTs into stable mir ADTs. +//! This module holds the logic to convert rustc internal ADTs into rustc_public ADTs. //! //! The conversion from stable to internal is not meant to be complete, //! and it should be added as when needed to be passed as input to rustc_public_bridge functions. diff --git a/compiler/rustc_public/src/unstable/mod.rs b/compiler/rustc_public/src/unstable/mod.rs index ca154a3378a..72b14cfa072 100644 --- a/compiler/rustc_public/src/unstable/mod.rs +++ b/compiler/rustc_public/src/unstable/mod.rs @@ -1,6 +1,6 @@ //! Module that collects the things that have no stability guarantees. //! -//! We want to keep StableMIR definitions and logic separate from +//! We want to keep rustc_public's IR definitions and logic separate from //! any sort of conversion and usage of internal rustc code. So we //! restrict the usage of internal items to be inside this module. @@ -53,16 +53,16 @@ pub trait InternalCx<'tcx>: Copy + Clone { fn adt_def(self, def_id: rustc_hir::def_id::DefId) -> ty::AdtDef<'tcx>; } -/// Trait used to convert between an internal MIR type to a Stable MIR type. +/// Trait used to convert between an internal MIR type to a rustc_public's IR type. /// -/// This trait is currently exposed to users so they can have interoperability between internal MIR -/// and StableMIR constructs. However, they should be used seldom and they have no influence -/// in this crate semver. +/// This trait is currently exposed to users so they can have interoperability +/// between internal MIR and rustc_public's IR constructs. +/// However, they should be used seldom and they have no influence in this crate semver. #[doc(hidden)] pub trait Stable<'tcx>: PointeeSized { /// The stable representation of the type implementing Stable. type T; - /// Converts an object to the equivalent Stable MIR representation. + /// Converts an object to the equivalent rustc_public's IR representation. fn stable<'cx>( &self, tables: &mut Tables<'cx, BridgeTys>, @@ -70,12 +70,13 @@ pub trait Stable<'tcx>: PointeeSized { ) -> Self::T; } -/// Trait used to translate a stable construct to its rustc counterpart. +/// Trait used to translate a rustc_public's IR construct to its rustc counterpart. /// /// This is basically a mirror of [Stable]. /// -/// This trait is currently exposed to users so they can have interoperability between internal MIR -/// and StableMIR constructs. They should be used seldom as they have no stability guarantees. +/// This trait is currently exposed to users so they can have interoperability +/// between internal MIR and rustc_public's IR constructs. +/// They should be used seldom as they have no stability guarantees. #[doc(hidden)] pub trait RustcInternal { type T<'tcx>; |
