@@ -62,7 +62,7 @@ impl<'tcx> HasLocalDecls<'tcx> for LocalDecls<'tcx> {
62
62
}
63
63
}
64
64
65
- impl < ' tcx > HasLocalDecls < ' tcx > for Mir < ' tcx > {
65
+ impl < ' tcx > HasLocalDecls < ' tcx > for Body < ' tcx > {
66
66
fn local_decls ( & self ) -> & LocalDecls < ' tcx > {
67
67
& self . local_decls
68
68
}
@@ -88,7 +88,7 @@ impl MirPhase {
88
88
89
89
/// Lowered representation of a single function.
90
90
#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
91
- pub struct Mir < ' tcx > {
91
+ pub struct Body < ' tcx > {
92
92
/// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
93
93
/// that indexes into this vector.
94
94
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
@@ -109,15 +109,15 @@ pub struct Mir<'tcx> {
109
109
pub source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
110
110
111
111
/// 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
113
113
/// in scope, but a separate set of locals.
114
- pub promoted : IndexVec < Promoted , Mir < ' tcx > > ,
114
+ pub promoted : IndexVec < Promoted , Body < ' tcx > > ,
115
115
116
116
/// Yields type of the function, if it is a generator.
117
117
pub yield_ty : Option < Ty < ' tcx > > ,
118
118
119
119
/// Generator drop glue
120
- pub generator_drop : Option < Box < Mir < ' tcx > > > ,
120
+ pub generator_drop : Option < Box < Body < ' tcx > > > ,
121
121
122
122
/// The layout of a generator. Produced by the state transformation.
123
123
pub generator_layout : Option < GeneratorLayout < ' tcx > > ,
@@ -169,12 +169,12 @@ pub struct Mir<'tcx> {
169
169
cache : cache:: Cache ,
170
170
}
171
171
172
- impl < ' tcx > Mir < ' tcx > {
172
+ impl < ' tcx > Body < ' tcx > {
173
173
pub fn new (
174
174
basic_blocks : IndexVec < BasicBlock , BasicBlockData < ' tcx > > ,
175
175
source_scopes : IndexVec < SourceScope , SourceScopeData > ,
176
176
source_scope_local_data : ClearCrossCrate < IndexVec < SourceScope , SourceScopeLocalData > > ,
177
- promoted : IndexVec < Promoted , Mir < ' tcx > > ,
177
+ promoted : IndexVec < Promoted , Body < ' tcx > > ,
178
178
yield_ty : Option < Ty < ' tcx > > ,
179
179
local_decls : LocalDecls < ' tcx > ,
180
180
user_type_annotations : CanonicalUserTypeAnnotations < ' tcx > ,
@@ -191,7 +191,7 @@ impl<'tcx> Mir<'tcx> {
191
191
local_decls. len( )
192
192
) ;
193
193
194
- Mir {
194
+ Body {
195
195
phase : MirPhase :: Build ,
196
196
basic_blocks,
197
197
source_scopes,
@@ -425,7 +425,7 @@ pub enum Safety {
425
425
ExplicitUnsafe ( hir:: HirId ) ,
426
426
}
427
427
428
- impl_stable_hash_for ! ( struct Mir <' tcx> {
428
+ impl_stable_hash_for ! ( struct Body <' tcx> {
429
429
phase,
430
430
basic_blocks,
431
431
source_scopes,
@@ -444,7 +444,7 @@ impl_stable_hash_for!(struct Mir<'tcx> {
444
444
cache
445
445
} ) ;
446
446
447
- impl < ' tcx > Index < BasicBlock > for Mir < ' tcx > {
447
+ impl < ' tcx > Index < BasicBlock > for Body < ' tcx > {
448
448
type Output = BasicBlockData < ' tcx > ;
449
449
450
450
#[ inline]
@@ -453,7 +453,7 @@ impl<'tcx> Index<BasicBlock> for Mir<'tcx> {
453
453
}
454
454
}
455
455
456
- impl < ' tcx > IndexMut < BasicBlock > for Mir < ' tcx > {
456
+ impl < ' tcx > IndexMut < BasicBlock > for Body < ' tcx > {
457
457
#[ inline]
458
458
fn index_mut ( & mut self , index : BasicBlock ) -> & mut BasicBlockData < ' tcx > {
459
459
& mut self . basic_blocks_mut ( ) [ index]
@@ -601,7 +601,7 @@ newtype_index! {
601
601
}
602
602
}
603
603
604
- /// Classifies locals into categories. See `Mir ::local_kind`.
604
+ /// Classifies locals into categories. See `Body ::local_kind`.
605
605
#[ derive( PartialEq , Eq , Debug , HashStable ) ]
606
606
pub enum LocalKind {
607
607
/// User-declared variable binding
@@ -2890,23 +2890,23 @@ fn def_path_str(def_id: DefId) -> String {
2890
2890
ty:: tls:: with ( |tcx| tcx. def_path_str ( def_id) )
2891
2891
}
2892
2892
2893
- impl < ' tcx > graph:: DirectedGraph for Mir < ' tcx > {
2893
+ impl < ' tcx > graph:: DirectedGraph for Body < ' tcx > {
2894
2894
type Node = BasicBlock ;
2895
2895
}
2896
2896
2897
- impl < ' tcx > graph:: WithNumNodes for Mir < ' tcx > {
2897
+ impl < ' tcx > graph:: WithNumNodes for Body < ' tcx > {
2898
2898
fn num_nodes ( & self ) -> usize {
2899
2899
self . basic_blocks . len ( )
2900
2900
}
2901
2901
}
2902
2902
2903
- impl < ' tcx > graph:: WithStartNode for Mir < ' tcx > {
2903
+ impl < ' tcx > graph:: WithStartNode for Body < ' tcx > {
2904
2904
fn start_node ( & self ) -> Self :: Node {
2905
2905
START_BLOCK
2906
2906
}
2907
2907
}
2908
2908
2909
- impl < ' tcx > graph:: WithPredecessors for Mir < ' tcx > {
2909
+ impl < ' tcx > graph:: WithPredecessors for Body < ' tcx > {
2910
2910
fn predecessors < ' graph > (
2911
2911
& ' graph self ,
2912
2912
node : Self :: Node ,
@@ -2915,7 +2915,7 @@ impl<'tcx> graph::WithPredecessors for Mir<'tcx> {
2915
2915
}
2916
2916
}
2917
2917
2918
- impl < ' tcx > graph:: WithSuccessors for Mir < ' tcx > {
2918
+ impl < ' tcx > graph:: WithSuccessors for Body < ' tcx > {
2919
2919
fn successors < ' graph > (
2920
2920
& ' graph self ,
2921
2921
node : Self :: Node ,
@@ -2924,12 +2924,12 @@ impl<'tcx> graph::WithSuccessors for Mir<'tcx> {
2924
2924
}
2925
2925
}
2926
2926
2927
- impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Mir < ' a > {
2927
+ impl < ' a , ' b > graph:: GraphPredecessors < ' b > for Body < ' a > {
2928
2928
type Item = BasicBlock ;
2929
2929
type Iter = IntoIter < BasicBlock > ;
2930
2930
}
2931
2931
2932
- impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Mir < ' a > {
2932
+ impl < ' a , ' b > graph:: GraphSuccessors < ' b > for Body < ' a > {
2933
2933
type Item = BasicBlock ;
2934
2934
type Iter = iter:: Cloned < Successors < ' b > > ;
2935
2935
}
@@ -2968,7 +2968,7 @@ impl Location {
2968
2968
}
2969
2969
2970
2970
/// Returns `true` if `other` is earlier in the control flow graph than `self`.
2971
- pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Mir < ' tcx > ) -> bool {
2971
+ pub fn is_predecessor_of < ' tcx > ( & self , other : Location , mir : & Body < ' tcx > ) -> bool {
2972
2972
// If we are in the same block as the other location and are an earlier statement
2973
2973
// then we are a predecessor of `other`.
2974
2974
if self . block == other. block && self . statement_index < other. statement_index {
@@ -3221,7 +3221,7 @@ CloneTypeFoldableAndLiftImpls! {
3221
3221
}
3222
3222
3223
3223
BraceStructTypeFoldableImpl ! {
3224
- impl <' tcx> TypeFoldable <' tcx> for Mir <' tcx> {
3224
+ impl <' tcx> TypeFoldable <' tcx> for Body <' tcx> {
3225
3225
phase,
3226
3226
basic_blocks,
3227
3227
source_scopes,
0 commit comments