From 3e5beb2c6f168b29f4a86c0d2a3e1c5e717d9389 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 29 May 2019 00:26:56 +0300 Subject: [PATCH] rustc: rename Mir to mir::Body in comments and to MIR in error strings. --- src/librustc/mir/interpret/mod.rs | 2 +- src/librustc/mir/visit.rs | 2 +- src/librustc/query/mod.rs | 2 +- src/librustc/ty/steal.rs | 6 +++--- src/librustc_mir/build/mod.rs | 4 ++-- src/librustc_mir/hair/cx/mod.rs | 2 +- src/librustc_mir/transform/mod.rs | 4 ++-- src/librustc_mir/transform/promote_consts.rs | 2 +- src/librustc_mir/transform/qualify_consts.rs | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs index 595ea8bd34687..902dc59e67f09 100644 --- a/src/librustc/mir/interpret/mod.rs +++ b/src/librustc/mir/interpret/mod.rs @@ -47,7 +47,7 @@ pub struct GlobalId<'tcx> { /// For a promoted global, the `Instance` of the function they belong to. pub instance: ty::Instance<'tcx>, - /// The index for promoted globals within their function's `Mir`. + /// The index for promoted globals within their function's `mir::Body`. pub promoted: Option, } diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 01c815fba9f3c..dd33fae0d6197 100644 --- a/src/librustc/mir/visit.rs +++ b/src/librustc/mir/visit.rs @@ -261,7 +261,7 @@ macro_rules! make_mir_visitor { } // for best performance, we want to use an iterator rather - // than a for-loop, to avoid calling Mir::invalidate for + // than a for-loop, to avoid calling `mir::Body::invalidate` for // each basic block. macro_rules! basic_blocks { (mut) => (mir.basic_blocks_mut().iter_enumerated_mut()); diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 39d91d66a438f..81aa8d434d37f 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -88,7 +88,7 @@ rustc_queries! { desc { "getting a list of all mir_keys" } } - /// Maps DefId's that have an associated Mir to the result + /// Maps DefId's that have an associated `mir::Body` to the result /// of the MIR qualify_consts pass. The actual meaning of /// the value isn't known except to the pass itself. query mir_const_qualif(key: DefId) -> (u8, &'tcx BitSet) { diff --git a/src/librustc/ty/steal.rs b/src/librustc/ty/steal.rs index a5a0b198734c1..711e59dbcc9d2 100644 --- a/src/librustc/ty/steal.rs +++ b/src/librustc/ty/steal.rs @@ -7,9 +7,9 @@ use rustc_data_structures::sync::{RwLock, ReadGuard, MappedReadGuard}; /// optimization, but that'd be expensive. And yet we don't just want /// to mutate it in place, because that would spoil the idea that /// queries are these pure functions that produce an immutable value -/// (since if you did the query twice, you could observe the -/// mutations). So instead we have the query produce a `&'tcx -/// Steal>` (to be very specific). Now we can read from this +/// (since if you did the query twice, you could observe the mutations). +/// So instead we have the query produce a `&'tcx Steal>` +/// (to be very specific). Now we can read from this /// as much as we want (using `borrow()`), but you can also /// `steal()`. Once you steal, any further attempt to read will panic. /// Therefore, we know that -- assuming no ICE -- nobody is observing diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index 5d79ef6a4bbc9..5797f9c347866 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -164,7 +164,7 @@ pub fn mir_build<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Body<' build::construct_const(cx, body_id, return_ty, return_ty_span) }; - // Convert the Mir to global types. + // Convert the `mir::Body` to global types. let mut globalizer = GlobalizeMir { tcx, span: mir.span @@ -243,7 +243,7 @@ fn create_constructor_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, tcx.infer_ctxt().enter(|infcx| { let mut mir = shim::build_adt_ctor(&infcx, ctor_id, fields, span); - // Convert the Mir to global types. + // Convert the `mir::Body` to global types. let tcx = infcx.tcx.global_tcx(); let mut globalizer = GlobalizeMir { tcx, diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index 9798d7e8a16dd..80f64e85f9cf9 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -44,7 +44,7 @@ pub struct Cx<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> { /// Whether this constant/function needs overflow checks. check_overflow: bool, - /// See field with the same name on `Mir`. + /// See field with the same name on `mir::Body`. control_flow_destroyed: Vec<(Span, String)>, } diff --git a/src/librustc_mir/transform/mod.rs b/src/librustc_mir/transform/mod.rs index 3fd4e6044af74..22b96a9db4750 100644 --- a/src/librustc_mir/transform/mod.rs +++ b/src/librustc_mir/transform/mod.rs @@ -100,7 +100,7 @@ fn mir_built<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx Stea tcx.alloc_steal_mir(mir) } -/// Where a specific Mir comes from. +/// Where a specific `mir::Body` comes from. #[derive(Debug, Copy, Clone)] pub struct MirSource<'tcx> { pub instance: InstanceDef<'tcx>, @@ -228,7 +228,7 @@ fn mir_validated<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx } fn optimized_mir<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> &'tcx Body<'tcx> { - // (Mir-)Borrowck uses `mir_validated`, so we have to force it to + // `mir_borrowck` uses `mir_validated`, so we have to force it to // execute before we can steal. tcx.ensure().mir_borrowck(def_id); diff --git a/src/librustc_mir/transform/promote_consts.rs b/src/librustc_mir/transform/promote_consts.rs index 24f810cceaf86..4b95fbf4b7d2f 100644 --- a/src/librustc_mir/transform/promote_consts.rs +++ b/src/librustc_mir/transform/promote_consts.rs @@ -393,7 +393,7 @@ pub fn promote_candidates<'a, 'tcx>(mir: &mut Body<'tcx>, } - // Declare return place local so that `Body::new` doesn't complain. + // Declare return place local so that `mir::Body::new` doesn't complain. let initial_locals = iter::once( LocalDecl::new_return_place(tcx.types.never, mir.span) ).collect(); diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 862c863500c80..a416792101f73 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -1431,7 +1431,7 @@ fn mir_const_qualif<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let mir = &tcx.mir_const(def_id).borrow(); if mir.return_ty().references_error() { - tcx.sess.delay_span_bug(mir.span, "mir_const_qualif: Mir had errors"); + tcx.sess.delay_span_bug(mir.span, "mir_const_qualif: MIR had errors"); return (1 << IsNotPromotable::IDX, tcx.arena.alloc(BitSet::new_empty(0))); } @@ -1447,7 +1447,7 @@ impl MirPass for QualifyAndPromoteConstants { mir: &mut Body<'tcx>) { // There's not really any point in promoting errorful MIR. if mir.return_ty().references_error() { - tcx.sess.delay_span_bug(mir.span, "QualifyAndPromoteConstants: Mir had errors"); + tcx.sess.delay_span_bug(mir.span, "QualifyAndPromoteConstants: MIR had errors"); return; }