@@ -62,7 +62,7 @@ impl<'tcx> HasLocalDecls<'tcx> for LocalDecls<'tcx> {
6262 }
6363}
6464
65- impl < ' tcx > HasLocalDecls < ' tcx > for Mir < ' tcx > {
65+ impl < ' tcx > HasLocalDecls < ' tcx > for Body < ' tcx > {
6666 fn local_decls ( & self ) -> & LocalDecls < ' tcx > {
6767 & self . local_decls
6868 }
@@ -88,7 +88,7 @@ impl MirPhase {
8888
8989/// Lowered representation of a single function.
9090#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
91- pub struct Mir < ' tcx > {
91+ pub struct Body < ' tcx > {
9292 /// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
9393 /// that indexes into this vector.
9494 basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
@@ -109,15 +109,15 @@ pub struct Mir<'tcx> {
109109 pub source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
110110
111111 /// Rvalues promoted from this function, such as borrows of constants.
112- /// Each of them is the Mir of a constant with the fn's type parameters
112+ /// Each of them is the Body of a constant with the fn's type parameters
113113 /// in scope, but a separate set of locals.
114- pub promoted : IndexVec < Promoted , Mir < ' tcx > > ,
114+ pub promoted : IndexVec < Promoted , Body < ' tcx > > ,
115115
116116 /// Yields type of the function, if it is a generator.
117117 pub yield_ty : Option < Ty < ' tcx > > ,
118118
119119 /// Generator drop glue
120- pub generator_drop : Option < Box < Mir < ' tcx > > > ,
120+ pub generator_drop : Option < Box < Body < ' tcx > > > ,
121121
122122 /// The layout of a generator. Produced by the state transformation.
123123 pub generator_layout : Option < GeneratorLayout < ' tcx > > ,
@@ -169,12 +169,12 @@ pub struct Mir<'tcx> {
169169 cache : cache:: Cache ,
170170}
171171
172- impl < ' tcx > Mir < ' tcx > {
172+ impl < ' tcx > Body < ' tcx > {
173173 pub fn new (
174174 basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
175175 source_scopes : IndexVec < SourceScope , SourceScopeData > ,
176176 source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
177- promoted : IndexVec < Promoted , Mir < ' tcx > > ,
177+ promoted : IndexVec < Promoted , Body < ' tcx > > ,
178178 yield_ty : Option < Ty < ' tcx > > ,
179179 local_decls : LocalDecls < ' tcx > ,
180180 user_type_annotations : CanonicalUserTypeAnnotations < ' tcx > ,
@@ -191,7 +191,7 @@ impl<'tcx> Mir<'tcx> {
191191 local_decls. len( )
192192 ) ;
193193
194- Mir {
194+ Body {
195195 phase : MirPhase :: Build ,
196196 basic_blocks,
197197 source_scopes,
@@ -425,7 +425,7 @@ pub enum Safety {
425425 ExplicitUnsafe ( hir:: HirId ) ,
426426}
427427
428- impl_stable_hash_for ! ( struct Mir <' tcx> {
428+ impl_stable_hash_for ! ( struct Body <' tcx> {
429429 phase,
430430 basic_blocks,
431431 source_scopes,
@@ -444,7 +444,7 @@ impl_stable_hash_for!(struct Mir<'tcx> {
444444 cache
445445} ) ;
446446
447- impl < ' tcx > Index < BasicBlock > for Mir < ' tcx > {
447+ impl < ' tcx > Index < BasicBlock > for Body < ' tcx > {
448448 type Output = BasicBlockData < ' tcx > ;
449449
450450 #[ inline]
@@ -453,7 +453,7 @@ impl<'tcx> Index<BasicBlock> for Mir<'tcx> {
453453 }
454454}
455455
456- impl < ' tcx > IndexMut < BasicBlock > for Mir < ' tcx > {
456+ impl < ' tcx > IndexMut < BasicBlock > for Body < ' tcx > {
457457 #[ inline]
458458 fn index_mut ( & mut self , index : BasicBlock ) -> & mut BasicBlockData < ' tcx > {
459459 & mut self . basic_blocks_mut ( ) [ index]
@@ -601,7 +601,7 @@ newtype_index! {
601601 }
602602}
603603
604- /// Classifies locals into categories. See `Mir ::local_kind`.
604+ /// Classifies locals into categories. See `Body ::local_kind`.
605605#[ derive( PartialEq , Eq , Debug , HashStable ) ]
606606pub enum LocalKind {
607607 /// User-declared variable binding
@@ -2897,23 +2897,23 @@ fn def_path_str(def_id: DefId) -> String {
28972897 ty:: tls:: with ( |tcx| tcx. def_path_str ( def_id) )
28982898}
28992899
2900- impl < ' tcx > graph:: DirectedGraph for Mir < ' tcx > {
2900+ impl < ' tcx > graph:: DirectedGraph for Body < ' tcx > {
29012901 type Node = BasicBlock ;
29022902}
29032903
2904- impl < ' tcx > graph:: WithNumNodes for Mir < ' tcx > {
2904+ impl < ' tcx > graph:: WithNumNodes for Body < ' tcx > {
29052905 fn num_nodes ( & self ) -> usize {
29062906 self . basic_blocks . len ( )
29072907 }
29082908}
29092909
2910- impl < ' tcx > graph:: WithStartNode for Mir < ' tcx > {
2910+ impl < ' tcx > graph:: WithStartNode for Body < ' tcx > {
29112911 fn start_node ( & self ) -> Self :: Node {
29122912 START_BLOCK
29132913 }
29142914}
29152915
2916- impl < ' tcx > graph:: WithPredecessors for Mir < ' tcx > {
2916+ impl < ' tcx > graph:: WithPredecessors for Body < ' tcx > {
29172917 fn predecessors < ' graph > (
29182918 & ' graph self ,
29192919 node : Self :: Node ,
@@ -2922,7 +2922,7 @@ impl<'tcx> graph::WithPredecessors for Mir<'tcx> {
29222922 }
29232923}
29242924
2925- impl < ' tcx > graph:: WithSuccessors for Mir < ' tcx > {
2925+ impl < ' tcx > graph:: WithSuccessors for Body < ' tcx > {
29262926 fn successors < ' graph > (
29272927 & ' graph self ,
29282928 node : Self :: Node ,
@@ -2931,12 +2931,12 @@ impl<'tcx> graph::WithSuccessors for Mir<'tcx> {
29312931 }
29322932}
29332933
2934- impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Mir < ' a > {
2934+ impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Body < ' a > {
29352935 type Item = BasicBlock ;
29362936 type Iter = IntoIter < BasicBlock > ;
29372937}
29382938
2939- impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Mir < ' a > {
2939+ impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Body < ' a > {
29402940 type Item = BasicBlock ;
29412941 type Iter = iter:: Cloned < Successors < ' b > > ;
29422942}
@@ -2975,7 +2975,7 @@ impl Location {
29752975 }
29762976
29772977 /// Returns `true` if `other` is earlier in the control flow graph than `self`.
2978- pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Mir < ' tcx > ) -> bool {
2978+ pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Body < ' tcx > ) -> bool {
29792979 // If we are in the same block as the other location and are an earlier statement
29802980 // then we are a predecessor of `other`.
29812981 if self . block == other. block && self . statement_index < other. statement_index {
@@ -3228,7 +3228,7 @@ CloneTypeFoldableAndLiftImpls! {
32283228}
32293229
32303230BraceStructTypeFoldableImpl ! {
3231- impl <' tcx> TypeFoldable <' tcx> for Mir <' tcx> {
3231+ impl <' tcx> TypeFoldable <' tcx> for Body <' tcx> {
32323232 phase,
32333233 basic_blocks,
32343234 source_scopes,
0 commit comments