Skip to content

Commit 6a87e95

Browse files
committed
Update docs in rustc_public
1 parent 7bd295e commit 6a87e95

File tree

13 files changed

+31
-30
lines changed

13 files changed

+31
-30
lines changed

compiler/rustc_public/src/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Memory allocation implementation for StableMIR.
1+
//! Memory allocation implementation for rustc_public.
22
//!
33
//! This module is responsible for constructing stable components.
44
//! All operations requiring rustc queries must be delegated

compiler/rustc_public/src/compiler_interface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Define the interface with the Rust compiler.
22
//!
3-
//! StableMIR users should not use any of the items in this module directly.
3+
//! rustc_public users should not use any of the items in this module directly.
44
//! These APIs have no stability guarantee.
55
66
use std::cell::Cell;
@@ -1067,7 +1067,7 @@ where
10671067
F: FnOnce() -> T,
10681068
{
10691069
if TLV.is_set() {
1070-
Err(Error::from("StableMIR already running"))
1070+
Err(Error::from("rustc_public already running"))
10711071
} else {
10721072
let ptr: *const () = (&raw const interface) as _;
10731073
TLV.set(&Cell::new(ptr), || Ok(f()))

compiler/rustc_public/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! When things go wrong, we need some error handling.
2-
//! There are a few different types of errors in StableMIR:
2+
//! There are a few different types of errors in rustc_public:
33
//!
44
//! - [CompilerError]: This represents errors that can be raised when invoking the compiler.
55
//! - [Error]: Generic error that represents the reason why a request that could not be fulfilled.

compiler/rustc_public/src/mir/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::target::{Endian, MachineInfo};
99
use crate::ty::{Allocation, Binder, ExistentialTraitRef, Ty};
1010
use crate::{Error, IndexedVal, with};
1111

12-
/// An allocation in the SMIR global memory can be either a function pointer,
12+
/// An allocation in the rustc_public's IR global memory can be either a function pointer,
1313
/// a static, or a "real" allocation with some data in it.
1414
#[derive(Debug, Clone, Eq, PartialEq, Serialize)]
1515
pub enum GlobalAlloc {

compiler/rustc_public/src/mir/body.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::ty::{
1010
};
1111
use crate::{Error, Opaque, Span, Symbol};
1212

13-
/// The SMIR representation of a single function.
13+
/// The rustc_public's IR representation of a single function.
1414
#[derive(Clone, Debug, Serialize)]
1515
pub struct Body {
1616
pub blocks: Vec<BasicBlock>,
@@ -771,8 +771,8 @@ pub enum VarDebugInfoContents {
771771
// In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This
772772
// is so it can be used for both Places (for which the projection elements are of type
773773
// ProjectionElem<Local, Ty>) and user-provided type annotations (for which the projection elements
774-
// are of type ProjectionElem<(), ()>). In SMIR we don't need this generality, so we just use
775-
// ProjectionElem for Places.
774+
// are of type ProjectionElem<(), ()>).
775+
// In rustc_public's IR we don't need this generality, so we just use ProjectionElem for Places.
776776
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
777777
pub enum ProjectionElem {
778778
/// Dereference projections (e.g. `*_1`) project to the address referenced by the base place.

compiler/rustc_public/src/mir/mono.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Instance {
6262
/// For more information on fallback body, see <https://github.com/rust-lang/rust/issues/93145>.
6363
///
6464
/// This call is much cheaper than `instance.body().is_some()`, since it doesn't try to build
65-
/// the StableMIR body.
65+
/// the rustc_public's IR body.
6666
pub fn has_body(&self) -> bool {
6767
with(|cx| cx.has_body(self.def.def_id()))
6868
}
@@ -157,7 +157,7 @@ impl Instance {
157157
///
158158
/// Allow users to check if this shim can be ignored when called directly.
159159
///
160-
/// We have decided not to export different types of Shims to StableMIR users, however, this
160+
/// We have decided not to export different types of Shims to rustc_public users, however, this
161161
/// is a query that can be very helpful for users when processing DropGlue.
162162
///
163163
/// When generating code for a Drop terminator, users can ignore an empty drop glue.

compiler/rustc_public/src/mir/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Implement methods to pretty print stable MIR body.
1+
//! Implement methods to pretty print rustc_public's IR body.
22
use std::fmt::Debug;
33
use std::io::Write;
44
use std::{fmt, io, iter};

compiler/rustc_public/src/mir/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! # The Stable MIR Visitor
1+
//! # The rustc_public's IR Visitor
22
//!
33
//! ## Overview
44
//!

compiler/rustc_public/src/rustc_internal/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//! Module that implements the bridge between Stable MIR and internal compiler MIR.
1+
//! Module that implements the bridge between rustc_public's IR and internal compiler MIR.
22
//!
33
//! For that, we define APIs that will temporarily be public to 3P that exposes rustc internal APIs
4-
//! until stable MIR is complete.
4+
//! until rustc_public's IR is complete.
55
66
use std::cell::{Cell, RefCell};
77

@@ -26,7 +26,7 @@ pub mod pretty;
2626
///
2727
/// # Panics
2828
///
29-
/// This function will panic if StableMIR has not been properly initialized.
29+
/// This function will panic if rustc_public has not been properly initialized.
3030
pub fn stable<'tcx, S: Stable<'tcx>>(item: S) -> S::T {
3131
with_container(|tables, cx| item.stable(tables, cx))
3232
}
@@ -41,7 +41,7 @@ pub fn stable<'tcx, S: Stable<'tcx>>(item: S) -> S::T {
4141
///
4242
/// # Panics
4343
///
44-
/// This function will panic if StableMIR has not been properly initialized.
44+
/// This function will panic if rustc_public has not been properly initialized.
4545
pub fn internal<'tcx, S>(tcx: TyCtxt<'tcx>, item: S) -> S::T<'tcx>
4646
where
4747
S: RustcInternal,
@@ -57,7 +57,7 @@ pub fn crate_num(item: &crate::Crate) -> CrateNum {
5757
}
5858

5959
// A thread local variable that stores a pointer to the tables mapping between TyCtxt
60-
// datastructures and stable MIR datastructures
60+
// datastructures and rustc_public's IR datastructures
6161
scoped_thread_local! (static TLV: Cell<*const ()>);
6262

6363
pub(crate) fn init<'tcx, F, T, B: Bridge>(container: &Container<'tcx, B>, f: F) -> T
@@ -176,7 +176,7 @@ macro_rules! optional {
176176

177177
/// Prefer using [run!] and [run_with_tcx] instead.
178178
///
179-
/// This macro implements the instantiation of a StableMIR driver, and it will invoke
179+
/// This macro implements the instantiation of a rustc_public driver, and it will invoke
180180
/// the given callback after the compiler analyses.
181181
///
182182
/// The third argument determines whether the callback requires `tcx` as an argument.

compiler/rustc_public/src/rustc_internal/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use super::run;
77
pub fn write_smir_pretty<'tcx, W: io::Write>(tcx: TyCtxt<'tcx>, w: &mut W) -> io::Result<()> {
88
writeln!(
99
w,
10-
"// WARNING: This is highly experimental output it's intended for stable-mir developers only."
10+
"// WARNING: This is highly experimental output it's intended for rustc_public developers only."
1111
)?;
1212
writeln!(
1313
w,

0 commit comments

Comments
 (0)