Skip to content

Commit 3e5beb2

Browse files
committed
rustc: rename Mir to mir::Body in comments and to MIR in error strings.
1 parent 6e5e0da commit 3e5beb2

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/librustc/mir/interpret/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct GlobalId<'tcx> {
4747
/// For a promoted global, the `Instance` of the function they belong to.
4848
pub instance: ty::Instance<'tcx>,
4949

50-
/// The index for promoted globals within their function's `Mir`.
50+
/// The index for promoted globals within their function's `mir::Body`.
5151
pub promoted: Option<mir::Promoted>,
5252
}
5353

src/librustc/mir/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ macro_rules! make_mir_visitor {
261261
}
262262

263263
// for best performance, we want to use an iterator rather
264-
// than a for-loop, to avoid calling Mir::invalidate for
264+
// than a for-loop, to avoid calling `mir::Body::invalidate` for
265265
// each basic block.
266266
macro_rules! basic_blocks {
267267
(mut) => (mir.basic_blocks_mut().iter_enumerated_mut());

src/librustc/query/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ rustc_queries! {
8888
desc { "getting a list of all mir_keys" }
8989
}
9090

91-
/// Maps DefId's that have an associated Mir to the result
91+
/// Maps DefId's that have an associated `mir::Body` to the result
9292
/// of the MIR qualify_consts pass. The actual meaning of
9393
/// the value isn't known except to the pass itself.
9494
query mir_const_qualif(key: DefId) -> (u8, &'tcx BitSet<mir::Local>) {

src/librustc/ty/steal.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use rustc_data_structures::sync::{RwLock, ReadGuard, MappedReadGuard};
77
/// optimization, but that'd be expensive. And yet we don't just want
88
/// to mutate it in place, because that would spoil the idea that
99
/// queries are these pure functions that produce an immutable value
10-
/// (since if you did the query twice, you could observe the
11-
/// mutations). So instead we have the query produce a `&'tcx
12-
/// Steal<Body<'tcx>>` (to be very specific). Now we can read from this
10+
/// (since if you did the query twice, you could observe the mutations).
11+
/// So instead we have the query produce a `&'tcx Steal<mir::Body<'tcx>>`
12+
/// (to be very specific). Now we can read from this
1313
/// as much as we want (using `borrow()`), but you can also
1414
/// `steal()`. Once you steal, any further attempt to read will panic.
1515
/// Therefore, we know that -- assuming no ICE -- nobody is observing

src/librustc_mir/build/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub fn mir_build<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Body<'
164164
build::construct_const(cx, body_id, return_ty, return_ty_span)
165165
};
166166

167-
// Convert the Mir to global types.
167+
// Convert the `mir::Body` to global types.
168168
let mut globalizer = GlobalizeMir {
169169
tcx,
170170
span: mir.span
@@ -243,7 +243,7 @@ fn create_constructor_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
243243
tcx.infer_ctxt().enter(|infcx| {
244244
let mut mir = shim::build_adt_ctor(&infcx, ctor_id, fields, span);
245245

246-
// Convert the Mir to global types.
246+
// Convert the `mir::Body` to global types.
247247
let tcx = infcx.tcx.global_tcx();
248248
let mut globalizer = GlobalizeMir {
249249
tcx,

src/librustc_mir/hair/cx/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub struct Cx<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
4444
/// Whether this constant/function needs overflow checks.
4545
check_overflow: bool,
4646

47-
/// See field with the same name on `Mir`.
47+
/// See field with the same name on `mir::Body`.
4848
control_flow_destroyed: Vec<(Span, String)>,
4949
}
5050

src/librustc_mir/transform/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn mir_built<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx Stea
100100
tcx.alloc_steal_mir(mir)
101101
}
102102

103-
/// Where a specific Mir comes from.
103+
/// Where a specific `mir::Body` comes from.
104104
#[derive(Debug, Copy, Clone)]
105105
pub struct MirSource<'tcx> {
106106
pub instance: InstanceDef<'tcx>,
@@ -228,7 +228,7 @@ fn mir_validated<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx
228228
}
229229

230230
fn optimized_mir<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx Body<'tcx> {
231-
// (Mir-)Borrowck uses `mir_validated`, so we have to force it to
231+
// `mir_borrowck` uses `mir_validated`, so we have to force it to
232232
// execute before we can steal.
233233
tcx.ensure().mir_borrowck(def_id);
234234

src/librustc_mir/transform/promote_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ pub fn promote_candidates<'a, 'tcx>(mir: &mut Body<'tcx>,
393393
}
394394

395395

396-
// Declare return place local so that `Body::new` doesn't complain.
396+
// Declare return place local so that `mir::Body::new` doesn't complain.
397397
let initial_locals = iter::once(
398398
LocalDecl::new_return_place(tcx.types.never, mir.span)
399399
).collect();

src/librustc_mir/transform/qualify_consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ fn mir_const_qualif<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
14311431
let mir = &tcx.mir_const(def_id).borrow();
14321432

14331433
if mir.return_ty().references_error() {
1434-
tcx.sess.delay_span_bug(mir.span, "mir_const_qualif: Mir had errors");
1434+
tcx.sess.delay_span_bug(mir.span, "mir_const_qualif: MIR had errors");
14351435
return (1 << IsNotPromotable::IDX, tcx.arena.alloc(BitSet::new_empty(0)));
14361436
}
14371437

@@ -1447,7 +1447,7 @@ impl MirPass for QualifyAndPromoteConstants {
14471447
mir: &mut Body<'tcx>) {
14481448
// There's not really any point in promoting errorful MIR.
14491449
if mir.return_ty().references_error() {
1450-
tcx.sess.delay_span_bug(mir.span, "QualifyAndPromoteConstants: Mir had errors");
1450+
tcx.sess.delay_span_bug(mir.span, "QualifyAndPromoteConstants: MIR had errors");
14511451
return;
14521452
}
14531453

0 commit comments

Comments
 (0)